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