Sakibrumu commited on
Commit
78753d4
·
verified ·
1 Parent(s): a76678a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -20
app.py CHANGED
@@ -7,27 +7,10 @@ from PIL import Image
7
  import sys
8
  import os
9
 
10
- import sys
11
- from pathlib import Path
12
- import dill._dill
13
- import torch
14
- from torch.serialization import add_safe_globals, safe_globals
15
- from torch.nn import Sequential
16
-
17
- # Yolov10 import path add
18
- sys.path.append(str(Path(__file__).resolve().parent / "yolov10"))
19
-
20
- # Import YOLOv10 classes
21
- from ultralytics.nn.tasks import YOLOv10DetectionModel
22
- from ultralytics.nn.modules.conv import Conv # ✅ নতুনটা
23
- from ultralytics import YOLO
24
-
25
- # Add trusted globals
26
- add_safe_globals([YOLOv10DetectionModel, dill._dill._load_type, Sequential, Conv])
27
 
28
- # Safely load the model
29
- with safe_globals([YOLOv10DetectionModel, dill._dill._load_type, Sequential, Conv]):
30
- model = YOLO('/home/user/app/best.pt')
31
 
32
 
33
 
 
7
  import sys
8
  import os
9
 
10
+ from yolov10.ultralytics import YOLO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
+ # Load model
13
+ model = YOLO("/home/user/app/best.pt") # আপনি যেই path এ best.pt রেখেছেন
 
14
 
15
 
16