Spaces:
Runtime error
Runtime error
Commit
•
4ff7dbe
1
Parent(s):
455fb97
Cambio la ruta output del video
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ except:
|
|
5 |
os.system('pip install git+https://github.com/facebookresearch/detectron2.git')
|
6 |
|
7 |
import gradio as gr
|
8 |
-
|
9 |
import torch
|
10 |
import numpy as np
|
11 |
|
@@ -25,17 +25,21 @@ article = '<p>Prueba de texto <a href="">https://www2.deloitte.com/es/es.html</a
|
|
25 |
# if 'detectron' not in filename:
|
26 |
# print(os.path.join(dirname, filename))
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
def inference(video):
|
30 |
print(video)
|
31 |
print('Antes de lanzar el modelo')
|
32 |
-
orden = 'python carpeta_deteccion/demo/demo.py --config-file carpeta_deteccion/configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml --video-input ' + video + ' --confidence-threshold 0.6 --output
|
33 |
os.system(orden)
|
34 |
for dirname, _, filenames in os.walk('/home/user/app'):
|
35 |
for filename in filenames:
|
36 |
print(os.path.join(dirname, filename))
|
37 |
print('Tras lanzar el modelo')
|
38 |
-
return
|
39 |
|
40 |
|
41 |
gr.Interface(inference,
|
|
|
5 |
os.system('pip install git+https://github.com/facebookresearch/detectron2.git')
|
6 |
|
7 |
import gradio as gr
|
8 |
+
import uuid
|
9 |
import torch
|
10 |
import numpy as np
|
11 |
|
|
|
25 |
# if 'detectron' not in filename:
|
26 |
# print(os.path.join(dirname, filename))
|
27 |
|
28 |
+
output = str(uuid.uuid4())
|
29 |
+
output += '.mp4'
|
30 |
+
|
31 |
+
print(output)
|
32 |
+
|
33 |
def inference(video):
|
34 |
print(video)
|
35 |
print('Antes de lanzar el modelo')
|
36 |
+
orden = 'python carpeta_deteccion/demo/demo.py --config-file carpeta_deteccion/configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml --video-input ' + video + ' --confidence-threshold 0.6 --output ' + output + ' --opts MODEL.WEIGHTS detectron2://COCO-PanopticSegmentation/panoptic_fpn_R_101_3x/139514519/model_final_cafdb1.pkl'
|
37 |
os.system(orden)
|
38 |
for dirname, _, filenames in os.walk('/home/user/app'):
|
39 |
for filename in filenames:
|
40 |
print(os.path.join(dirname, filename))
|
41 |
print('Tras lanzar el modelo')
|
42 |
+
return output
|
43 |
|
44 |
|
45 |
gr.Interface(inference,
|