Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,8 @@ from PIL import Image
|
|
| 6 |
# .h5 파일을 이용한 모델 로드
|
| 7 |
model = tf.keras.models.load_model('keras_model.h5')
|
| 8 |
|
| 9 |
-
# 클래스 레이블
|
| 10 |
-
class_labels = ['disposablecup', 'envmark', 'label','mug','nonlabel','reusablecup']
|
| 11 |
|
| 12 |
# 이미지 전처리 함수
|
| 13 |
def preprocess_image(image):
|
|
@@ -28,7 +28,7 @@ def predict(image):
|
|
| 28 |
# Gradio 인터페이스 설정
|
| 29 |
interface = gr.Interface(
|
| 30 |
fn=predict,
|
| 31 |
-
inputs=gr.Image(source="
|
| 32 |
outputs=gr.Textbox(label="Predicted Class"),
|
| 33 |
live=True
|
| 34 |
)
|
|
|
|
| 6 |
# .h5 파일을 이용한 모델 로드
|
| 7 |
model = tf.keras.models.load_model('keras_model.h5')
|
| 8 |
|
| 9 |
+
# 클래스 레이블
|
| 10 |
+
class_labels = ['disposablecup', 'envmark', 'label','mug','nonlabel','reusablecup']
|
| 11 |
|
| 12 |
# 이미지 전처리 함수
|
| 13 |
def preprocess_image(image):
|
|
|
|
| 28 |
# Gradio 인터페이스 설정
|
| 29 |
interface = gr.Interface(
|
| 30 |
fn=predict,
|
| 31 |
+
inputs=gr.Image(type="numpy", source="upload", tool="editor"),
|
| 32 |
outputs=gr.Textbox(label="Predicted Class"),
|
| 33 |
live=True
|
| 34 |
)
|