omarelsayeed
commited on
Commit
•
a231a61
1
Parent(s):
630cb01
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
# !pip install ultralytics
|
2 |
from ultralytics import ASSETS, YOLO, RTDETR
|
3 |
import gradio as gr
|
4 |
from huggingface_hub import snapshot_download
|
5 |
from PIL import Image
|
6 |
|
7 |
-
model_dir = snapshot_download("omarelsayeed/DETR-ARABIC-DOCUMENT-LAYOUT-ANALYSIS") + "/
|
8 |
model = RTDETR(model_dir)
|
9 |
|
10 |
|
@@ -16,7 +15,7 @@ def predict_image(img, conf_threshold, iou_threshold):
|
|
16 |
iou=iou_threshold,
|
17 |
show_labels=True,
|
18 |
show_conf=True,
|
19 |
-
imgsz=
|
20 |
)
|
21 |
|
22 |
for r in results:
|
|
|
|
|
1 |
from ultralytics import ASSETS, YOLO, RTDETR
|
2 |
import gradio as gr
|
3 |
from huggingface_hub import snapshot_download
|
4 |
from PIL import Image
|
5 |
|
6 |
+
model_dir = snapshot_download("omarelsayeed/DETR-ARABIC-DOCUMENT-LAYOUT-ANALYSIS") + "/rtdetr_1024.pt"
|
7 |
model = RTDETR(model_dir)
|
8 |
|
9 |
|
|
|
15 |
iou=iou_threshold,
|
16 |
show_labels=True,
|
17 |
show_conf=True,
|
18 |
+
imgsz=1024,
|
19 |
)
|
20 |
|
21 |
for r in results:
|