atalaydenknalbant commited on
Commit
36e4f2e
·
1 Parent(s): 4dd00a1

uploaded initial files

Browse files
Files changed (5) hide show
  1. README.md +1 -1
  2. a.jpg +0 -0
  3. app.py +46 -0
  4. b.jpg +0 -0
  5. best.pt +3 -0
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: ASL Detector YOLOV9
3
- emoji: 🐠
4
  colorFrom: red
5
  colorTo: gray
6
  sdk: gradio
 
1
  ---
2
  title: ASL Detector YOLOV9
3
+ emoji: ✊🏼
4
  colorFrom: red
5
  colorTo: gray
6
  sdk: gradio
a.jpg ADDED
app.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import spaces
2
+ import PIL.Image as Image
3
+ import gradio as gr
4
+ from ultralytics import ASSETS, YOLO
5
+
6
+
7
+ model = YOLO("best.pt")
8
+
9
+ @spaces.GPU
10
+ def predict_image(img, conf_threshold, iou_threshold):
11
+ results = model.predict(
12
+ source=img,
13
+ device="cuda:0",
14
+ conf=conf_threshold,
15
+ iou=iou_threshold,
16
+ show_labels=True,
17
+ show_conf=True,
18
+ imgsz=416,
19
+ max_det=1
20
+ )
21
+
22
+ for r in results:
23
+ im_array = r.plot()
24
+ im = Image.fromarray(im_array[..., ::-1])
25
+
26
+ return im
27
+
28
+
29
+ asl = gr.Interface(
30
+ fn=predict_image,
31
+ inputs=[
32
+ gr.Image(type="pil", label="Upload Image"),
33
+ gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
34
+ gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold")
35
+ ],
36
+ outputs=gr.Image(type="pil", label="Result"),
37
+ title="ASL Detector YOLOv9e",
38
+ description="Upload images for inference. The Ultralytics YOLOv9e model is used by default. Letter Z is not supported.",
39
+ examples=[
40
+ [ASSETS / "a.jpg", 0.25, 0.45],
41
+ [ASSETS / "b.jpg", 0.25, 0.45],
42
+ ]
43
+ )
44
+
45
+ if __name__ == '__main__':
46
+ asl.launch()
b.jpg ADDED
best.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4dab1e073a4a428e1f26aa5b0864a0e93094519737f4efeb64cadd986958e0bc
3
+ size 117279194