Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ transform = transforms.Compose([
|
|
| 18 |
# Function to classify posture images
|
| 19 |
def classify_image(image):
|
| 20 |
if image is None:
|
| 21 |
-
return "No image provided! Please
|
| 22 |
|
| 23 |
image = transform(image).unsqueeze(0)
|
| 24 |
output = model(image)
|
|
@@ -29,8 +29,6 @@ def classify_image(image):
|
|
| 29 |
else "Bad Posture, you should think of sitting a little straighter or more in frame for your real interview."
|
| 30 |
)
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
img_input = gr.Image
|
|
|
|
| 18 |
# Function to classify posture images
|
| 19 |
def classify_image(image):
|
| 20 |
if image is None:
|
| 21 |
+
return "No image provided! Please upload or capture an image."
|
| 22 |
|
| 23 |
image = transform(image).unsqueeze(0)
|
| 24 |
output = model(image)
|
|
|
|
| 29 |
else "Bad Posture, you should think of sitting a little straighter or more in frame for your real interview."
|
| 30 |
)
|
| 31 |
|
| 32 |
+
# Set up Gradio interface
|
| 33 |
+
iface = gr.Interface(fn=classify_image, inputs=gr.Image(type="pil"), outputs="text")
|
| 34 |
+
iface.launch()
|
|
|
|
|
|