Update app.py
Browse files
app.py
CHANGED
@@ -43,14 +43,14 @@ def run_model():
|
|
43 |
|
44 |
label_product = text_list[model_image_to_text[0]]
|
45 |
|
46 |
-
return
|
47 |
|
48 |
def predict(image):
|
49 |
# Save the image to the desired file path
|
50 |
cv2.imwrite(image_paths[0], cv2.cvtColor(image, cv2.COLOR_RGB2BGR))
|
51 |
return run_model()
|
52 |
|
53 |
-
demo =
|
54 |
fn=predict,
|
55 |
inputs=gr.inputs.Image(),
|
56 |
outputs=gr.outputs.Label()
|
|
|
43 |
|
44 |
label_product = text_list[model_image_to_text[0]]
|
45 |
|
46 |
+
return database[label_product]
|
47 |
|
48 |
def predict(image):
|
49 |
# Save the image to the desired file path
|
50 |
cv2.imwrite(image_paths[0], cv2.cvtColor(image, cv2.COLOR_RGB2BGR))
|
51 |
return run_model()
|
52 |
|
53 |
+
demo = gr.Interface(
|
54 |
fn=predict,
|
55 |
inputs=gr.inputs.Image(),
|
56 |
outputs=gr.outputs.Label()
|