mohamedsaeed823 commited on
Commit
56364c9
1 Parent(s): 63492c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -55,15 +55,14 @@ def recognize_gesture(image):
55
  top_gesture = recognition_result.gestures[0][0]
56
 
57
  # Return the gesture label and score
58
- return dict(zip(eng_ara_mapping[top_gesture.category_name], map(float,top_gesture.score)))
59
-
60
 
61
  iface = gr.Interface(
62
  fn=recognize_gesture,
63
- inputs=gr.Image(sources=["upload","clipboard"]), # Input type: image
64
- outputs=gr.Label(num_top_classes=4), # Output type: label
65
  title="Arabic Sign Language Character Recognition",
66
- description="Upload an image to recognize the character",
67
  )
68
 
69
- iface.launch(share=True) # Launch the interface in a web browser
 
55
  top_gesture = recognition_result.gestures[0][0]
56
 
57
  # Return the gesture label and score
58
+ return f"Gesture recognized: {eng_ara_mapping[top_gesture.category_name]} ({top_gesture.score:.2f})"
 
59
 
60
  iface = gr.Interface(
61
  fn=recognize_gesture,
62
+ inputs=["image"], # Input type: image
63
+ outputs="text", # Output type: text
64
  title="Arabic Sign Language Character Recognition",
65
+ description="Upload an image to recognize the gesture",
66
  )
67
 
68
+ iface.launch() # Launch the interface in a web browser