diff --git a/test.py b/eval.py similarity index 99% rename from test.py rename to eval.py index ed7e29c..4aa692e 100644 --- a/test.py +++ b/eval.py @@ -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') diff --git a/train.py b/train.py index 879bb2e..1c28fec 100644 --- a/train.py +++ b/train.py @@ -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'), diff --git a/utils/utils.py b/utils/utils.py index ce1d910..209e884 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -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()