Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
8de0c3f
1
Parent(s):
d942a8d
Fix example path, Add more information
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import re
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import gradio as gr
|
| 4 |
import matplotlib.pyplot as plt
|
|
@@ -63,8 +64,10 @@ def run_canvas(front_view, map_view, prompt):
|
|
| 63 |
|
| 64 |
return pil_img
|
| 65 |
|
|
|
|
|
|
|
| 66 |
examples = [
|
| 67 |
-
["src/office/0a1f277a93fed629365ac5863c20c64e_frontview_6.0.png", "src/office/0a1f277a93fed629365ac5863c20c64e_map_6.0.png", """You are an indoor food-serving robot.
|
| 68 |
|
| 69 |
You must follow these driving instructions:
|
| 70 |
1. You must avoid collisions.
|
|
@@ -76,7 +79,7 @@ You must follow these driving instructions:
|
|
| 76 |
a. Indoors, you should drive at a speed of 3-4km/h.
|
| 77 |
5. You must slow down(2km/h or lower) if a human or obstacle comes within 1.5m radius.
|
| 78 |
a. You must slow down(2km/h or lower) in areas where a human could suddenly appear from a blind spot."""],
|
| 79 |
-
["src/orchard/d578264e1e51cc5b8f0e496ab381cee4_frontview_79.0.png", "src/orchard/d578264e1e51cc5b8f0e496ab381cee4_map_79.0.png", """You are an outdoor speed-sprayer robot.
|
| 80 |
|
| 81 |
You must follow these driving instructions:
|
| 82 |
1. You must avoid collisions.
|
|
@@ -85,7 +88,7 @@ You must follow these driving instructions:
|
|
| 85 |
a. If the Trajectory Instruction cannot be followed due to any obstacles, you should deviate to bypass the obstacle.
|
| 86 |
b. You should try to evade any identifiable obstacles.
|
| 87 |
4. You should maintain a constant driving speed."""],
|
| 88 |
-
["src/sidewalk/2d0dde2a98083b7d60b24651d37532dc_frontview_4.0.png", "src/sidewalk/2d0dde2a98083b7d60b24651d37532dc_map_4.0.png", """You are an outdoor last mile delivery robot.
|
| 89 |
|
| 90 |
You must follow these driving instructions:
|
| 91 |
1. You must avoid collisions.
|
|
@@ -96,7 +99,7 @@ You must follow these driving instructions:
|
|
| 96 |
4. You should maintain a constant driving speed.
|
| 97 |
5. You must drive on the sidewalk.
|
| 98 |
a. If you need to cross the road, you must use the crosswalk."""],
|
| 99 |
-
["src/road/3cfce98ab33a3dc8d43584d5a7039cf5_frontview_8.75.png", "src/road/3cfce98ab33a3dc8d43584d5a7039cf5_map_8.75.png", """You are an outdoor self-driving robot taxi.
|
| 100 |
|
| 101 |
You must follow these driving instructions:
|
| 102 |
1. You must avoid collisions.
|
|
@@ -119,7 +122,7 @@ demo = gr.Interface(
|
|
| 119 |
],
|
| 120 |
outputs = gr.Image(label="generated waypoint"),
|
| 121 |
title="CANVAS Demo",
|
| 122 |
-
description="This is the demo of the CANVAS-S model from CANVAS: Commonsense-Aware Navigation System for Intuitive Human-Robot Interaction",
|
| 123 |
examples=examples
|
| 124 |
)
|
| 125 |
|
|
|
|
| 1 |
import re
|
| 2 |
+
import os
|
| 3 |
import numpy as np
|
| 4 |
import gradio as gr
|
| 5 |
import matplotlib.pyplot as plt
|
|
|
|
| 64 |
|
| 65 |
return pil_img
|
| 66 |
|
| 67 |
+
examples_path = os.path.dirname(__file__)
|
| 68 |
+
|
| 69 |
examples = [
|
| 70 |
+
[f"{examples_path}/src/office/0a1f277a93fed629365ac5863c20c64e_frontview_6.0.png", f"{examples_path}/src/office/0a1f277a93fed629365ac5863c20c64e_map_6.0.png", """You are an indoor food-serving robot.
|
| 71 |
|
| 72 |
You must follow these driving instructions:
|
| 73 |
1. You must avoid collisions.
|
|
|
|
| 79 |
a. Indoors, you should drive at a speed of 3-4km/h.
|
| 80 |
5. You must slow down(2km/h or lower) if a human or obstacle comes within 1.5m radius.
|
| 81 |
a. You must slow down(2km/h or lower) in areas where a human could suddenly appear from a blind spot."""],
|
| 82 |
+
[f"{examples_path}/src/orchard/d578264e1e51cc5b8f0e496ab381cee4_frontview_79.0.png", f"{examples_path}/src/orchard/d578264e1e51cc5b8f0e496ab381cee4_map_79.0.png", """You are an outdoor speed-sprayer robot.
|
| 83 |
|
| 84 |
You must follow these driving instructions:
|
| 85 |
1. You must avoid collisions.
|
|
|
|
| 88 |
a. If the Trajectory Instruction cannot be followed due to any obstacles, you should deviate to bypass the obstacle.
|
| 89 |
b. You should try to evade any identifiable obstacles.
|
| 90 |
4. You should maintain a constant driving speed."""],
|
| 91 |
+
[f"{examples_path}/src/sidewalk/2d0dde2a98083b7d60b24651d37532dc_frontview_4.0.png", f"{examples_path}/src/sidewalk/2d0dde2a98083b7d60b24651d37532dc_map_4.0.png", """You are an outdoor last mile delivery robot.
|
| 92 |
|
| 93 |
You must follow these driving instructions:
|
| 94 |
1. You must avoid collisions.
|
|
|
|
| 99 |
4. You should maintain a constant driving speed.
|
| 100 |
5. You must drive on the sidewalk.
|
| 101 |
a. If you need to cross the road, you must use the crosswalk."""],
|
| 102 |
+
[f"{examples_path}/src/road/3cfce98ab33a3dc8d43584d5a7039cf5_frontview_8.75.png", f"{examples_path}/src/road/3cfce98ab33a3dc8d43584d5a7039cf5_map_8.75.png", """You are an outdoor self-driving robot taxi.
|
| 103 |
|
| 104 |
You must follow these driving instructions:
|
| 105 |
1. You must avoid collisions.
|
|
|
|
| 122 |
],
|
| 123 |
outputs = gr.Image(label="generated waypoint"),
|
| 124 |
title="CANVAS Demo",
|
| 125 |
+
description=gr.Markdown("This is the demo of the [CANVAS-S](https://huggingface.co/maum-ai/CANVAS-S) model from our paper, [CANVAS: Commonsense-Aware Navigation System for Intuitive Human-Robot Interaction](https://worv-ai.github.io/canvas)"),
|
| 126 |
examples=examples
|
| 127 |
)
|
| 128 |
|