Skip to content

Commit

Permalink
Remove is_coco argument from test() (ultralytics#3553)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jun 9, 2021
1 parent a708b90 commit 7b687c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def test(data,
wandb_logger=None,
compute_loss=None,
half_precision=True,
is_coco=False,
opt=None):
# Initialize/load model and set device
training = model is not None
Expand Down Expand Up @@ -71,10 +70,10 @@ def test(data,
# Configure
model.eval()
if isinstance(data, str):
is_coco = data.endswith('coco.yaml')
with open(data) as f:
data = yaml.safe_load(f)
check_dataset(data) # check
is_coco = data['val'].endswith('coco/val2017.txt') # COCO dataset
nc = 1 if single_cls else int(data['nc']) # number of classes
iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for mAP@0.5:0.95
niou = iouv.numel()
Expand Down
6 changes: 2 additions & 4 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ def train(hyp, opt, device, tb_writer=None):
verbose=nc < 50 and final_epoch,
plots=plots and final_epoch,
wandb_logger=wandb_logger,
compute_loss=compute_loss,
is_coco=is_coco)
compute_loss=compute_loss)

# Write
with open(results_file, 'a') as f:
Expand Down Expand Up @@ -434,8 +433,7 @@ def train(hyp, opt, device, tb_writer=None):
dataloader=testloader,
save_dir=save_dir,
save_json=True,
plots=False,
is_coco=is_coco)
plots=False)

# Strip optimizers
for f in last, best:
Expand Down

0 comments on commit 7b687c5

Please sign in to comment.