Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from generate_scenario.final import GENETRAFFICAPI | |
| def greet(general, event): | |
| description = general | |
| moving_description = event | |
| curr_map = "Town10HD" | |
| gen = GENETRAFFICAPI(description, moving_description, curr_map) | |
| res = gen.generate_xosc() | |
| return res | |
| demo = gr.Interface( | |
| fn=greet, | |
| inputs=[gr.Textbox(lines=2, placeholder="Scenario Description General:"), | |
| gr.Textbox(lines=2, placeholder="Scenario Description Event:"),], | |
| outputs="text", | |
| ) | |
| demo.launch() | |
| # the Vehicle A was traveling normally on the road, when vehicle B rear-ended vehicle A. | |
| # Vehicle carA is driving normally. Later, carA will turn left and vehicle carB, traveling in the opposite direction on a different lane, will have collision with carA. Additionally, on the same lane of carA, carC is driving normally on the rear of carA | |
| # Event1: the adversary car move with speed 27 when it's at the distance of 21 from hero car. Event2:the adversary car stop when the collision happen on hero car. |