@@ -233,7 +233,7 @@ def test(data, | |||
if __name__ == '__main__': | |||
parser = argparse.ArgumentParser(prog='test.py') | |||
parser = argparse.ArgumentParser(prog='eval.py') | |||
parser.add_argument('--weights', nargs='+', type=str, default='yolov5s.pt', help='model.pt path(s)') | |||
parser.add_argument('--data', type=str, default='data/coco128.yaml', help='*.data path') | |||
parser.add_argument('--batch-size', type=int, default=32, help='size of each image batch') |
@@ -7,7 +7,7 @@ import torch.optim.lr_scheduler as lr_scheduler | |||
import torch.utils.data | |||
from torch.utils.tensorboard import SummaryWriter | |||
import test # import test.py to get mAP after each epoch | |||
import eval # import eval.py to get mAP after each epoch | |||
from models.yolo import Model | |||
from utils import google_utils | |||
from utils.datasets import * | |||
@@ -291,7 +291,7 @@ def train(hyp): | |||
ema.update_attr(model, include=['md', 'nc', 'hyp', 'gr', 'names', 'stride']) | |||
final_epoch = epoch + 1 == epochs | |||
if not opt.notest or final_epoch: # Calculate mAP | |||
results, maps, times = test.test(opt.data, | |||
results, maps, times = eval.test(opt.data, | |||
batch_size=batch_size, | |||
imgsz=imgsz_test, | |||
save_json=final_epoch and opt.data.endswith(os.sep + 'coco.yaml'), |
@@ -1087,7 +1087,7 @@ def plot_targets_txt(): # from utils.utils import *; plot_targets_txt() | |||
def plot_study_txt(f='study.txt', x=None): # from utils.utils import *; plot_study_txt() | |||
# Plot study.txt generated by test.py | |||
# Plot study.txt generated by eval.py | |||
fig, ax = plt.subplots(2, 4, figsize=(10, 6), tight_layout=True) | |||
ax = ax.ravel() | |||