yusyel commited on
Commit
43ac702
1 Parent(s): ef36984
app.py CHANGED
@@ -33,12 +33,10 @@ def preprocess_image(img):
33
  def predict(img):
34
  img = preprocess_image(img)
35
  pred = model.predict(img)
36
- print(pred)
37
- pred = np.round(np.squeeze(pred).astype(float),5)
38
- print(pred)
39
  return dict(zip(class_names, pred))
40
 
41
-
42
  demo = gr.Interface(
43
  fn=predict,
44
  inputs=[gr.inputs.Image(type="filepath")],
33
  def predict(img):
34
  img = preprocess_image(img)
35
  pred = model.predict(img)
36
+ pred = np.squeeze(np.exp(pred)/np.sum(np.exp(pred))).astype(float)
37
+ print(dict(zip(class_names, pred)))
 
38
  return dict(zip(class_names, pred))
39
 
 
40
  demo = gr.Interface(
41
  fn=predict,
42
  inputs=[gr.inputs.Image(type="filepath")],
flagged/img/998b370ed87eda7eab93098d8a78a5878a4968dd/tmpiwkw8t51.jpg ADDED
flagged/log.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ img,output,flag,username,timestamp
2
+ /home/yusuf/okul/clothing/flagged/img/998b370ed87eda7eab93098d8a78a5878a4968dd/tmpiwkw8t51.jpg,/home/yusuf/okul/clothing/flagged/output/tmpit0cnsjg.json,,,2023-08-24 22:43:40.643622
flagged/output/tmpit0cnsjg.json ADDED
@@ -0,0 +1 @@
 
1
+ {"label": "longsleee", "confidences": [{"label": "longsleee", "confidence": 1.6803}, {"label": "dress", "confidence": 1.36643}, {"label": "shorts", "confidence": 0.14555}, {"label": "outwear", "confidence": -0.08118}, {"label": "shirt", "confidence": -0.17827}, {"label": "t-shirt", "confidence": -0.229}, {"label": "hat", "confidence": -2.12421}, {"label": "skirt", "confidence": -2.7243}, {"label": "shoes", "confidence": -2.90811}, {"label": "pants", "confidence": -3.0658}]}
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
- gradio==3.41.0
2
  numpy==1.23.3
3
  tensorflow==2.9.1
1
+ gradio==3.38.0
2
  numpy==1.23.3
3
  tensorflow==2.9.1
test.ipynb ADDED
File without changes