Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ from utils.visualization import FactoryVisualizer
|
|
| 9 |
|
| 10 |
def process_video(video):
|
| 11 |
with tempfile.TemporaryDirectory() as tmpdir:
|
|
|
|
| 12 |
# 1. ํคํ๋ ์ ์ถ์ถ
|
| 13 |
frames_dir = os.path.join(tmpdir, "frames")
|
| 14 |
os.makedirs(frames_dir, exist_ok=True)
|
|
@@ -51,9 +52,13 @@ def process_video(video):
|
|
| 51 |
|
| 52 |
# 4. ๋ชจ๋ธ ๋ฐ ๊ฒฐ๊ณผ ํ์ผ ์ ์ฅ
|
| 53 |
obj_path = os.path.join(tmpdir, "factory.obj")
|
|
|
|
|
|
|
| 54 |
pointcloud.export(obj_path)
|
| 55 |
html_path = export_to_webgl(obj_path, tmpdir)
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
return (
|
| 58 |
obj_path,
|
| 59 |
html_path,
|
|
@@ -61,6 +66,7 @@ def process_video(video):
|
|
| 61 |
os.path.join(vis_dir, "top_view.png"),
|
| 62 |
os.path.join(vis_dir, "distribution.png")
|
| 63 |
)
|
|
|
|
| 64 |
|
| 65 |
iface = gr.Interface(
|
| 66 |
fn=process_video,
|
|
|
|
| 9 |
|
| 10 |
def process_video(video):
|
| 11 |
with tempfile.TemporaryDirectory() as tmpdir:
|
| 12 |
+
print(f"์์ ๋๋ ํ ๋ฆฌ ์์ฑ: {tmpdir}") # ๊ฒฝ๋ก ํ์ธ
|
| 13 |
# 1. ํคํ๋ ์ ์ถ์ถ
|
| 14 |
frames_dir = os.path.join(tmpdir, "frames")
|
| 15 |
os.makedirs(frames_dir, exist_ok=True)
|
|
|
|
| 52 |
|
| 53 |
# 4. ๋ชจ๋ธ ๋ฐ ๊ฒฐ๊ณผ ํ์ผ ์ ์ฅ
|
| 54 |
obj_path = os.path.join(tmpdir, "factory.obj")
|
| 55 |
+
if len(pc_points) < 3: # ์ต์ 3๊ฐ ํฌ์ธํธ ํ์
|
| 56 |
+
raise gr.Error("ํฌ์ธํธ ํด๋ผ์ฐ๋ ์์ฑ ์คํจ: ์ถฉ๋ถํ ๋ฐ์ดํฐ ์์")
|
| 57 |
pointcloud.export(obj_path)
|
| 58 |
html_path = export_to_webgl(obj_path, tmpdir)
|
| 59 |
+
|
| 60 |
+
print("์์ฑ๋ ํ์ผ ๋ชฉ๋ก:", os.listdir(tmpdir)) # ํ์ผ ์กด์ฌ ์ฌ๋ถ ํ์ธ
|
| 61 |
+
|
| 62 |
return (
|
| 63 |
obj_path,
|
| 64 |
html_path,
|
|
|
|
| 66 |
os.path.join(vis_dir, "top_view.png"),
|
| 67 |
os.path.join(vis_dir, "distribution.png")
|
| 68 |
)
|
| 69 |
+
|
| 70 |
|
| 71 |
iface = gr.Interface(
|
| 72 |
fn=process_video,
|