tommy24 commited on
Commit
e198e28
·
1 Parent(s): 7c817a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,7 +26,7 @@ with open("labels.txt", "r") as file:
26
 
27
  def classify(image_path):
28
  try:
29
- output = {}
30
  for i in output:
31
  image_data = np.array(image_path)
32
  image_data = cv.resize(image_data, (224, 224))
@@ -76,7 +76,7 @@ def classify(image_path):
76
 
77
  reply = response["choices"][0]["message"]["content"]
78
 
79
- output.append("type": max_label, "prediction_value": {round(max_prediction_value, 2)}, "content": reply)
80
 
81
  return output
82
 
 
26
 
27
  def classify(image_path):
28
  try:
29
+ output = []
30
  for i in output:
31
  image_data = np.array(image_path)
32
  image_data = cv.resize(image_data, (224, 224))
 
76
 
77
  reply = response["choices"][0]["message"]["content"]
78
 
79
+ output.append({"type": max_label, "prediction_value": round(max_prediction_value, 2), "content": reply})
80
 
81
  return output
82