hank1996 commited on
Commit
e74c4a2
·
1 Parent(s): 4c0c74d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -72,14 +72,18 @@ def detect(img,model):
72
  half = device.type != 'cpu' # half precision only supported on CUDA
73
 
74
  # Load model
75
- print(weights)
 
 
 
 
 
 
 
 
76
  model = attempt_load(weights, map_location=device) # load FP32 model
77
- stride = int(model.stride.max()) # model stride
78
  imgsz = check_img_size(imgsz, s=stride) # check img_size
79
 
80
- #if trace:
81
- #model = TracedModel(model, device, opt.img_size)
82
-
83
  if half:
84
  model.half() # to FP16
85
 
 
72
  half = device.type != 'cpu' # half precision only supported on CUDA
73
 
74
  # Load model
75
+ inf_time = AverageMeter()
76
+ waste_time = AverageMeter()
77
+ nms_time = AverageMeter()
78
+
79
+ # Load model
80
+ stride =32
81
+ model = torch.jit.load(weights)
82
+ device = select_device(opt.device)
83
+ model = model.to(device)
84
  model = attempt_load(weights, map_location=device) # load FP32 model
 
85
  imgsz = check_img_size(imgsz, s=stride) # check img_size
86
 
 
 
 
87
  if half:
88
  model.half() # to FP16
89