datasciencedojo commited on
Commit
2dd4b1a
·
1 Parent(s): 3fdda2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -7,7 +7,7 @@ import gradio as gr
7
 
8
  #cap = cv2.VideoCapture(0)
9
  detector = HandDetector(maxHands=1)
10
- classifier = Classifier("Model/keras_model.h5", "Model/labels.txt")
11
 
12
  offset = 20
13
  imgSize = 300
@@ -15,7 +15,7 @@ imgSize = 300
15
  folder = "Data/C"
16
  counter = 0
17
 
18
- labels = ["A", "B"]
19
 
20
 
21
  def sign(img):
@@ -60,9 +60,9 @@ def sign(img):
60
  #cv2.rectangle(imgOutput, (x - offset, y - offset-50),
61
  # (x - offset+90, y - offset-50+50), (255, 0, 255), cv2.FILLED)
62
  #cv2.putText(imgOutput, labels[index], (x, y -26), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
63
- cv2.rectangle(imgOutput, (30,30),
64
  (80,80), (255, 0, 255), cv2.FILLED)
65
- cv2.putText(imgOutput, labels[index], (30, 80), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
66
 
67
 
68
  #cv2.imshow("ImageCrop", imgCrop)
@@ -86,4 +86,4 @@ with gr.Blocks() as demo:
86
  inputs = img_input2,
87
  outputs = output2)
88
 
89
- demo.launch(debug=True)
 
7
 
8
  #cap = cv2.VideoCapture(0)
9
  detector = HandDetector(maxHands=1)
10
+ classifier = Classifier("ModelFull/keras_model.h5", "ModelFull/labels.txt")
11
 
12
  offset = 20
13
  imgSize = 300
 
15
  folder = "Data/C"
16
  counter = 0
17
 
18
+ labels = ["A", "B","C","D","E","F","G","H","I","J","K","L","M","N", "O","P","Q","R","S","T","U","V","W","X","Y","Z"]
19
 
20
 
21
  def sign(img):
 
60
  #cv2.rectangle(imgOutput, (x - offset, y - offset-50),
61
  # (x - offset+90, y - offset-50+50), (255, 0, 255), cv2.FILLED)
62
  #cv2.putText(imgOutput, labels[index], (x, y -26), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
63
+ cv2.rectangle(imgOutput, (0,30),
64
  (80,80), (255, 0, 255), cv2.FILLED)
65
+ cv2.putText(imgOutput, labels[index], (20, 75), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
66
 
67
 
68
  #cv2.imshow("ImageCrop", imgCrop)
 
86
  inputs = img_input2,
87
  outputs = output2)
88
 
89
+ demo.launch(debug=True)