Pengi5659 commited on
Commit
dfa9fe7
·
verified ·
1 Parent(s): df258fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
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 capture or upload an image."
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
- # Create a compact Gradio layout using Blocks
33
- with gr.Blocks() as demo:
34
- gr.Markdown("### Posture Classifier")
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()