Spaces:
Runtime error
Runtime error
Geraldine J
commited on
Commit
·
e1ecf57
1
Parent(s):
368b420
Update dataframe and json
Browse files
app.py
CHANGED
@@ -48,33 +48,27 @@ model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_rel
|
|
48 |
#model = torch.hub.load('path/to/yolov5', 'custom', path='/content/yolov56.pt', source='local') # local repo
|
49 |
|
50 |
def listJSON(a,b,c,d):
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
return json_string
|
62 |
-
except Exception as e:
|
63 |
-
logging.error(e, exc_info=True)
|
64 |
|
65 |
def arrayLista(a,b):
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
return df
|
76 |
-
except Exception as e:
|
77 |
-
logging.error(e, exc_info=True)
|
78 |
|
79 |
def yolo(size, iou, conf, im):
|
80 |
try:
|
|
|
48 |
#model = torch.hub.load('path/to/yolov5', 'custom', path='/content/yolov56.pt', source='local') # local repo
|
49 |
|
50 |
def listJSON(a,b,c,d):
|
51 |
+
strlist =[]
|
52 |
+
strlist.append(a)
|
53 |
+
strlist.append(b)
|
54 |
+
strlist.append(c)
|
55 |
+
if d =='Pelicano\nSp':
|
56 |
+
strlist.append('Pelicano')
|
57 |
+
else:
|
58 |
+
strlist.append(d)
|
59 |
+
json_string = json.dumps(strlist)
|
60 |
+
return json_string
|
|
|
|
|
|
|
61 |
|
62 |
def arrayLista(a,b):
|
63 |
+
strlist =[{}]*1
|
64 |
+
strlist[0] = set()
|
65 |
+
strlist[0].add(a)
|
66 |
+
if b =='Pelicano\nSp':
|
67 |
+
strlist[0].add('Pelicano')
|
68 |
+
else:
|
69 |
+
strlist[0].add(b)
|
70 |
+
df = pd.DataFrame(strlist,columns=['Especie','Cantidad'])
|
71 |
+
return df
|
|
|
|
|
|
|
72 |
|
73 |
def yolo(size, iou, conf, im):
|
74 |
try:
|