Skip to content

Commit

Permalink
Remove expired parameters in detect.py (#263)
Browse files Browse the repository at this point in the history
* Remove expired parameters in detect.py

* Auto expand the image size if there is only element in the `img_size`
  • Loading branch information
triple-Mu authored Dec 30, 2021
1 parent ac6ec43 commit beed602
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tools/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,10 @@ def run(

# Load the TensorRT engine
device = select_device(device)
engine = PredictorTRT(
weights,
device=device,
score_thresh=conf_thres,
iou_thresh=iou_thres,
detections_per_img=max_det,
)
engine = PredictorTRT(weights, device=device)
stride, names = engine.stride, engine.names
img_size = check_img_size(img_size, stride=stride) # check image size

img_size *= 2 if len(img_size) == 1 else 1 # auto expand
# Dataloader
dataset = LoadImages(source, img_size=img_size, stride=stride, auto=False)

Expand Down

0 comments on commit beed602

Please sign in to comment.