{"id":23792464,"url":"https://github.com/se2p/crisce-tool","last_synced_at":"2026-03-03T18:02:28.553Z","repository":{"id":80472494,"uuid":"431152961","full_name":"se2p/crisce-tool","owner":"se2p","description":"This repository hosts the code of the CRISCE (CRItical SCEnario) tool by Jasim Ahmed and others.","archived":false,"fork":false,"pushed_at":"2021-11-24T10:36:47.000Z","size":51966,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-01T05:37:21.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/se2p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-23T15:26:51.000Z","updated_at":"2025-07-24T18:32:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"3270bbf9-c7b5-4ffa-95ca-7e0efcebed4d","html_url":"https://github.com/se2p/crisce-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/se2p/crisce-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2Fcrisce-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2Fcrisce-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2Fcrisce-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2Fcrisce-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/se2p","download_url":"https://codeload.github.com/se2p/crisce-tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2Fcrisce-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30054001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T17:46:22.538Z","status":"ssl_error","status_checked_at":"2026-03-03T17:46:22.036Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-01T18:35:06.782Z","updated_at":"2026-03-03T18:02:28.533Z","avatar_url":"https://github.com/se2p.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRISCE: Automatically Generating Critical Driving Scenarios From Car Accident Sketches\n\nThis document describes how to install and use CRISCE (CRItical SCEnario), the tool developed by Jasim Ahmed and others for automatically generate simulations of car crashed from accident sketches using [BeamNG.tech](https://beamng.tech/).\n\nA video demonstration of the tool is available on [YouTube](https://youtu.be/G8GJl4wTchI).\n\n## Repo Organization\n\n```\n.\n├── Datasets\n│   ├── CIREN\n│   └── SYNTH\n├── LICENSE\n├── PythonRobotics\n├── README.md\n├── beamngpy-1.18-py2.py3-none-any.whl\n├── crisce\n└── requirements.txt\n```\n\nThe `crisce` folder contains the source code of the tool.\nThe `Datasets` folder contains the sample accident sketches compatible with the tool: `CIREN` contains sketches from [NHTSA](https://crashviewer.nhtsa.dot.gov/LegacyCIREN/Search); `SYNT` contains synthetic sketches that we manually created from pre-existing car crash simulations in BeamNG.tech.\n\n`beamngpy-1.18-py2.py3-none-any.whl` is the wheel file necessary to manually install `beamngpy` the Python API to BeamNG.tech. Tl;DR: The package available on pypi is broken.\n\n`requirements.txt` lists the python packages needed to install the tool. They are in the usual format accepted by `pip`.\n\n## Dependencies\nCRISCE is a tool written in Python, therefore it requires a working Python installation. Specifically, we tested CRISCE with `Python 3.7.10`\n\nCRISCE uses the BeamNG.tech simulator to run the driving simulations. Therefore, BeamNG.tech must be installed as well. \n\n\u003e Note: the version of the simulator used by CRISCE is `BeamNG.research v1.7.0.1`\n\nBeamNG.tech is free for research use and can be requested to BeamNG.GmbH by submitting the form at the following link: [https://register.beamng.tech/](https://register.beamng.tech/)\n\n\u003e NOTE: BeamNG.tech currently supports only Windows, hence CRISCE cannot be used on other platforms (e.g., Linux/Mac) unless you can resort to full system virtualization. For example, we tested CRISCE using the commercial tool Parallels Desktop running on a Mac Book Pro. Performance will not be the same but at least it gets the job done.\n\n## Installation\n\n### Installing BeamNG.tech\nAfter successfully registered to [https://register.beamng.tech/](https://register.beamng.tech/), you should receive an email with the instructions to access the software and a registration key (i.e., `tech.key`).\n\nPlease download the `BeamNG.research v1.7.0.1` and unzip it somewhere in your system. \n\n\u003e ATTENTION: BeamNG cannot handle paths with spaces and special characters, so please install it in a location that matches these requirements. We suggest something simple, like `C:\\BeamNG.research_v1.7.0.1`.\n\nWe refer to this folder as `\u003cBEAMNG_HOME\u003e`\n\nStore a copy of the `tech.key` file in a folder somewhere in your system and rename this copy to `research.key`. BeamNG use this folder to cache the content and the simulation data. \n\n\u003e ATTENTION: BeamNG cannot handle paths with spaces and special characters, so please store the registration file in a location that matches these requirements. We suggest something simple, like `C:\\BeamNG_user`.\n\nWe refer to this folder as `\u003cBEAMNG_USER\u003e`\n\n### Installing CRISCE and its Dependencies\n\nWe exemplify the installation and usage of CRISCE using Windows Powershell; you can use other systems (e.g., PyCharm) but in that case you need to adapt the commands below.\n\nBefore starting, check that you have installed the right version of Python:\n\n```\npython.exe -V\n    Python 3.7.10\n```\n\nTo install CRISCE we suggest creating a virtual environment using `venv`. You can also use `conda` or similar, but in this case you need to adapt the command below to fit your case.\n\nMove to CRISCE's root folder (i.e., where this file is) and create a new virtual environment:\n\n```\npython.exe -m venv .venv\n```\n\nActivate the virtual environment and upgrade `pip`, `setup tools` and `wheel`.\n\n```\n.venv\\Scripts\\activate\npy.exe -m pip install --upgrade pip\npip install setuptools wheel --upgrade\n```\n\nInstall the python dependencies listed in the `requirements.txt`:\n\n```\npip install -r requirements.txt\n```\n\nAt this point, we need to install `beamingly` from the provided wheel file:\n\n```\npip install beamngpy-1.18-py2.py3-none-any.whl\n```\n\nFinally, we need to make sure the code of `PythonRobotics` is there:\n\n```\ngit submodule init\ngit submodule update\n```\n\nAt this point, you should be ready to go.\n\nConfirm that CRISCE is installed using the following command from the root folder of this repo:\n\n```\npy.exe crisce/app.py --help\n```\n\nThis command must produce an output similar to:\n\n```\nUsage: app.py [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --log-to PATH  Location of the log file. If not specified logs appear on the\n                 console\n  --debug        Activate debugging (results in more logging)  [default:\n                 (Disabled)]\n  --help         Show this message and exit.\n\nCommands:\n  generate\n```\n\n### Running CRISCE\nThe current release of CRISCE allows to generate a BeamNG simulation of a car crash from a single sketch using the command `generate`. This command accepts several parameters that you can list by invoking:\n\n```\npy.exe crisce/app.py generate --help\n\nUsage: app.py generate [OPTIONS]\n\nOptions:\n  --accident-sketch PATH        Input accident sketch for generating the\n                                simulation  [required]\n  --dataset-name [CIREN|SYNTH]  Name of the dataset the accident comes from.\n                                [required]\n  --output-to PATH              Folder to store outputs. It will created if\n                                not present. If omitted we use the accident\n                                folder.\n  --beamng-home PATH            Home folder of the BeamNG.research simulator\n                                [required]\n  --beamng-user PATH            User folder of the BeamNG.research simulator\n                                [required]\n  --help                        Show this message and exit.\n```\n\nThe following commands show how you can generate a simulation of a real car crash (i.e., from a sketch in the CIREN dataset) and from a simulated crash (i.e., from a sketch in the SYNTH dataset). The difference between the two dataset is that for sketches of real car crashes, we have information about the expected impact; while, for synthetic sketches the information is missing.\n\nFor example, to create a simulation form the following sketch (i.e., CIREN-99817):\n![CIREN-99817](./Datasets/CIREN/99817/sketch.jpeg)\n\n![CIREN-99817](./demo/99817.gif)\n\nyou can run the following command (after replacing `\u003cBEAMNG_HOME\u003e` and `\u003cBEAMNG_USER\u003e` with the appropriate values:\n\n```\npy.exe crisce/app.py generate generate --accident-sketch .\\Datasets\\CIREN\\99817\\ --dataset-name CIREN --beamng-home `\u003cBEAMNG_HOME\u003e` --beamng-user \u003cBEAMNG_USER\u003e\n```\n\nTo create a simulation form the following synthetic sketch (i.e., fourway_1):\n![CIREN-99817](./Datasets/SYNTH/fourway_1/sketch.jpg)\n\nyou can run the following command:\n\n```\npy.exe crisce/app.py generate generate --accident-sketch ./Datasets/SYNTH/fourway_1 --dataset-name SYNTH --beamng-home `\u003cBEAMNG_HOME\u003e` --beamng-user \u003cBEAMNG_USER\u003e\n```\n\n### Reporting\n\nThe `generate` command produces a number of intermediate outputs that show the progress of the computation and measure the accuracy of the simulation that is printed on the console:\n\n```\nQuality_of_environment = 33.0, quality_of_crash = 17.0, quality_of_trajecory = 19.009199327937655\nCrash Simulation Accuracy =  69.00919932793765 %\n```\n\nThe intermediate results instead are stored under the sketch folder (under `output`) or the folder configured via the `--output-to` parameter.\n\nFor the case CIREN-99817 for example, those are the intermediate results produced by CRISCE:\n\n```\noutput/\n├── car\n│   ├── 0_mask_result_b.jpg\n│   ├── 0_mask_result_r.jpg\n│   ├── 1_blend_masks_r_b.jpg\n│   ├── 1_blend_masks_res.jpg\n│   ├── 2_opening_morph.jpg\n│   ├── 3_AABB_OBB.jpg\n│   ├── 4_crash_point_visualization.jpg\n│   ├── 5_triangle_extraction.jpg\n│   ├── 6_angles_for_vehicles.jpg\n│   ├── 7_sequence_of_movements.jpg\n│   ├── 8_twelve_point_model_sides.jpg\n│   └── 9_crash_point_on_vehicles.jpg\n├── kinematics\n│   ├── 0_distorted_control_points.jpg\n│   ├── 1_distorted_control_points.jpg\n│   ├── 2_distorted_trajectory.jpg\n│   ├── 2_original_trajectory.jpg\n│   ├── 3_distorted_trajectory.jpg\n│   └── 3_original_trajectory.jpg\n├── road\n│   ├── 0_gray_image.jpg\n│   ├── 1_blur_image.jpg\n│   ├── 2_threshold_image.jpg\n│   ├── 3_dilate_image.jpg\n│   ├── 4_erode_image.jpg\n│   ├── 5_Contour_Viz_image.jpg\n│   ├── 6_midpoints_of_lane.jpg\n│   ├── 7_distortion_mapping.jpg\n│   └── 8_final_result.jpg\n├── simulation\n│   ├── 0_sim_plot_road.jpg\n│   ├── 1_sim_initial_pos_dir.jpg\n│   ├── 2_sim_bbox_traj.jpg\n│   ├── 3_crisce_beamng_efficiency.jpg\n│   ├── 3_crisce_efficiency.jpg\n│   └── 4_trace_veh_BBOX.jpg\n└── summary.json\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse2p%2Fcrisce-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fse2p%2Fcrisce-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse2p%2Fcrisce-tool/lists"}