Geraldine J commited on
Commit
8c9db40
1 Parent(s): 4d7b640

Update json and size

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -53,20 +53,6 @@ region = os.environ['region']
53
  def removeStr(string):
54
  return string.replace(" ", "")
55
 
56
- def qtyEspecies(datax, datay, resImg):
57
- numLobos = 0
58
- numPelicanos = 0
59
- dfEspecies = pd.DataFrame(datax)
60
- for i in range(0, dfEspecies['name'].size):
61
- if(dfEspecies['class'][i] == 0):
62
- numLobos= numLobos + 1
63
- if(dfEspecies['class'][i] == 1):
64
- numPelicanos= numPelicanos + 1
65
- strlista = '"detail":[{"quantity":"'+str(numLobos)+'","description":"Lobo marino"},{"quantity":"'+str(numPelicanos)+'","description":"Pelicano"}]'
66
- data = '{"image":"'+str(removeStr(datay[0:9]))+'","size":"'+str(removeStr(datay[11:18]))+'",'+strlista+','+resImg+'}'
67
- json_data = json.loads(data)
68
- return json_data
69
-
70
  def arrayLista(a,b,c,d):
71
  x = re.findall("obo Mar", b)
72
  y = re.findall("elica", b)
@@ -129,6 +115,21 @@ def upload_file(file_name, bucket=None, object_name=None):
129
  return False
130
  return stado
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  # Model
133
  model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True) # local model o google colab
134
 
 
53
  def removeStr(string):
54
  return string.replace(" ", "")
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  def arrayLista(a,b,c,d):
57
  x = re.findall("obo Mar", b)
58
  y = re.findall("elica", b)
 
115
  return False
116
  return stado
117
 
118
+ def qtyEspecies(datax, datay, resImg):
119
+ numLobos = 0
120
+ numPelicanos = 0
121
+ dfEspecies = pd.DataFrame(datax)
122
+ for i in range(0, dfEspecies['name'].size):
123
+ if(dfEspecies['class'][i] == 0):
124
+ numLobos= numLobos + 1
125
+ if(dfEspecies['class'][i] == 1):
126
+ numPelicanos= numPelicanos + 1
127
+ strlista = '"detail":[{"quantity":"'+str(numLobos)+'","description":"Lobo marino"},{"quantity":"'+str(numPelicanos)+'","description":"Pelicano"}]'
128
+ data = '{"image":"'+str(removeStr(datay[0:9]))+'","size":"'+str(removeStr(datay[11:18]))+'",'+strlista+','+resImg+'}'
129
+ json_data = json.loads(data)
130
+ return json_data
131
+
132
+
133
  # Model
134
  model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True) # local model o google colab
135