mohamedsaeed823 commited on
Commit
48cbe41
1 Parent(s): 4fa20fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -55,12 +55,12 @@ def recognize_gesture(image):
55
  top_gesture = recognition_result.gestures[0][0]
56
 
57
  # Return the gesture label and score
58
- return f"Character recognized: {eng_ara_mapping[top_gesture.category_name]} probability: ({top_gesture.score:.2f})"
59
 
60
  iface = gr.Interface(
61
  fn=recognize_gesture,
62
  inputs=gr.Image(sources=["upload","clipboard"]), # Input type: image
63
- outputs="text", # Output type: text
64
  title="Arabic Sign Language Character Recognition",
65
  description="Upload an image to recognize the character",
66
  )
 
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], {top_gesture.score:.2f})
59
 
60
  iface = gr.Interface(
61
  fn=recognize_gesture,
62
  inputs=gr.Image(sources=["upload","clipboard"]), # Input type: image
63
+ outputs=gr.Label(num_top_classes=4), # Output type: label
64
  title="Arabic Sign Language Character Recognition",
65
  description="Upload an image to recognize the character",
66
  )