Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,13 +23,15 @@ def predict(image):
|
|
| 23 |
predictions = model.predict(processed_image)
|
| 24 |
predicted_class_index = np.argmax(predictions, axis=-1)[0]
|
| 25 |
predicted_class_label = class_labels[predicted_class_index]
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# Gradio 인터페이스 설정
|
| 29 |
interface = gr.Interface(
|
| 30 |
fn=predict,
|
| 31 |
inputs=gr.Image(type="numpy"),
|
| 32 |
-
outputs=gr.Textbox(label="
|
| 33 |
live=True
|
| 34 |
)
|
| 35 |
|
|
|
|
| 23 |
predictions = model.predict(processed_image)
|
| 24 |
predicted_class_index = np.argmax(predictions, axis=-1)[0]
|
| 25 |
predicted_class_label = class_labels[predicted_class_index]
|
| 26 |
+
if predicted_class_label in ['disposablecup','label'] : missionresult = '인증에 실패했습니다.'
|
| 27 |
+
else : missionresult = '인증에 성공했습니다!'
|
| 28 |
+
return missionresult
|
| 29 |
|
| 30 |
# Gradio 인터페이스 설정
|
| 31 |
interface = gr.Interface(
|
| 32 |
fn=predict,
|
| 33 |
inputs=gr.Image(type="numpy"),
|
| 34 |
+
outputs=gr.Textbox(label="미션 결과"),
|
| 35 |
live=True
|
| 36 |
)
|
| 37 |
|