Update main.py
Browse files
main.py
CHANGED
|
@@ -23,18 +23,18 @@ from utils import (
|
|
| 23 |
)
|
| 24 |
import torch
|
| 25 |
|
| 26 |
-
|
| 27 |
#caption_model_processor = get_caption_model_processor(model_name="florence2", model_name_or_path="icon_caption_florence")
|
| 28 |
|
| 29 |
from ultralytics import YOLO
|
| 30 |
|
| 31 |
-
if not os.path.exists("
|
| 32 |
-
os.makedirs("
|
| 33 |
|
| 34 |
try:
|
| 35 |
-
yolo_model = YOLO("
|
| 36 |
except:
|
| 37 |
-
yolo_model = YOLO("
|
| 38 |
|
| 39 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
| 40 |
|
|
|
|
| 23 |
)
|
| 24 |
import torch
|
| 25 |
|
| 26 |
+
yolo_model = get_yolo_model(model_path='weights/icon_detect/best.pt')
|
| 27 |
#caption_model_processor = get_caption_model_processor(model_name="florence2", model_name_or_path="icon_caption_florence")
|
| 28 |
|
| 29 |
from ultralytics import YOLO
|
| 30 |
|
| 31 |
+
if not os.path.exists("weights/icon_detect"):
|
| 32 |
+
os.makedirs("weights/icon_detect")
|
| 33 |
|
| 34 |
try:
|
| 35 |
+
yolo_model = YOLO("weights/icon_detect/best.pt").to("cuda")
|
| 36 |
except:
|
| 37 |
+
yolo_model = YOLO("weights/icon_detect/best.pt")
|
| 38 |
|
| 39 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
| 40 |
|