Skip to content

Commit

Permalink
add to detect, test
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jan 7, 2021
1 parent 06ef2ea commit 7b7ed70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from models.experimental import attempt_load
from utils.datasets import LoadStreams, LoadImages
from utils.general import check_img_size, non_max_suppression, apply_classifier, scale_coords, xyxy2xywh, \
strip_optimizer, set_logging, increment_path
from utils.general import check_img_size, check_requirements, non_max_suppression, apply_classifier, scale_coords, \
xyxy2xywh, strip_optimizer, set_logging, increment_path
from utils.plots import plot_one_box
from utils.torch_utils import select_device, load_classifier, time_synchronized

Expand Down Expand Up @@ -162,6 +162,7 @@ def detect(save_img=False):
parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
opt = parser.parse_args()
print(opt)
check_requirements()

with torch.no_grad():
if opt.update: # update all models (to fix SourceChangeWarning)
Expand Down
5 changes: 3 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import coco80_to_coco91_class, check_dataset, check_file, check_img_size, box_iou, \
non_max_suppression, scale_coords, xyxy2xywh, xywh2xyxy, set_logging, increment_path
from utils.general import coco80_to_coco91_class, check_dataset, check_file, check_img_size, check_requirements, \
box_iou, non_max_suppression, scale_coords, xyxy2xywh, xywh2xyxy, set_logging, increment_path
from utils.loss import compute_loss
from utils.metrics import ap_per_class, ConfusionMatrix
from utils.plots import plot_images, output_to_target, plot_study_txt
Expand Down Expand Up @@ -302,6 +302,7 @@ def test(data,
opt.save_json |= opt.data.endswith('coco.yaml')
opt.data = check_file(opt.data) # check file
print(opt)
check_requirements()

if opt.task in ['val', 'test']: # run normally
test(opt.data,
Expand Down

0 comments on commit 7b7ed70

Please sign in to comment.