rename eval
This commit is contained in:
parent
df270ea9d7
commit
9a880a4554
6
eval.py
6
eval.py
|
|
@ -5,7 +5,7 @@ from models.experimental import *
|
||||||
from utils.datasets import *
|
from utils.datasets import *
|
||||||
|
|
||||||
|
|
||||||
def test(data,
|
def evaluate(data,
|
||||||
weights=None,
|
weights=None,
|
||||||
batch_size=16,
|
batch_size=16,
|
||||||
imgsz=640,
|
imgsz=640,
|
||||||
|
|
@ -254,7 +254,7 @@ if __name__ == '__main__':
|
||||||
print(opt)
|
print(opt)
|
||||||
|
|
||||||
if opt.task in ['val', 'test']: # run normally
|
if opt.task in ['val', 'test']: # run normally
|
||||||
test(opt.data,
|
evaluate(opt.data,
|
||||||
opt.weights,
|
opt.weights,
|
||||||
opt.batch_size,
|
opt.batch_size,
|
||||||
opt.img_size,
|
opt.img_size,
|
||||||
|
|
@ -272,7 +272,7 @@ if __name__ == '__main__':
|
||||||
y = [] # y axis
|
y = [] # y axis
|
||||||
for i in x: # img-size
|
for i in x: # img-size
|
||||||
print('\nRunning %s point %s...' % (f, i))
|
print('\nRunning %s point %s...' % (f, i))
|
||||||
r, _, t = test(opt.data, weights, opt.batch_size, i, opt.conf_thres, opt.iou_thres, opt.save_json)
|
r, _, t = evaluate(opt.data, weights, opt.batch_size, i, opt.conf_thres, opt.iou_thres, opt.save_json)
|
||||||
y.append(r + t) # results and times
|
y.append(r + t) # results and times
|
||||||
np.savetxt(f, y, fmt='%10.4g') # save
|
np.savetxt(f, y, fmt='%10.4g') # save
|
||||||
os.system('zip -r study.zip study_*.txt')
|
os.system('zip -r study.zip study_*.txt')
|
||||||
|
|
|
||||||
2
train.py
2
train.py
|
|
@ -291,7 +291,7 @@ def train(hyp):
|
||||||
ema.update_attr(model, include=['md', 'nc', 'hyp', 'gr', 'names', 'stride'])
|
ema.update_attr(model, include=['md', 'nc', 'hyp', 'gr', 'names', 'stride'])
|
||||||
final_epoch = epoch + 1 == epochs
|
final_epoch = epoch + 1 == epochs
|
||||||
if not opt.notest or final_epoch: # Calculate mAP
|
if not opt.notest or final_epoch: # Calculate mAP
|
||||||
results, maps, times = eval.test(opt.data,
|
results, maps, times = eval.evaluate(opt.data,
|
||||||
batch_size=batch_size,
|
batch_size=batch_size,
|
||||||
imgsz=imgsz_test,
|
imgsz=imgsz_test,
|
||||||
save_json=final_epoch and opt.data.endswith(os.sep + 'coco.yaml'),
|
save_json=final_epoch and opt.data.endswith(os.sep + 'coco.yaml'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue