소스 검색

test.py --task test updates

5.0
Glenn Jocher 4 년 전
부모
커밋
aa08b2bd6f
2개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. +1
    -1
      test.py
  2. +4
    -1
      utils/datasets.py

+ 1
- 1
test.py 파일 보기

@@ -165,7 +165,7 @@ def test(data,

# Compute statistics
stats = [np.concatenate(x, 0) for x in zip(*stats)] # to numpy
if len(stats):
if len(stats) and stats[0].any():
p, r, ap, f1, ap_class = ap_per_class(*stats)
p, r, ap50, ap = p[:, 0], r[:, 0], ap[:, 0], ap.mean(1) # [P, R, AP@0.5, AP@0.5:0.95]
mp, mr, map50, map = p.mean(), r.mean(), ap50.mean(), ap.mean()

+ 4
- 1
utils/datasets.py 파일 보기

@@ -416,7 +416,10 @@ class LoadImagesAndLabels(Dataset): # for training/testing

pbar.desc = 'Scanning labels %s (%g found, %g missing, %g empty, %g duplicate, for %g images)' % (
cache_path, nf, nm, ne, nd, n)
assert nf > 0, 'No labels found in %s. See %s' % (os.path.dirname(file) + os.sep, help_url)
if nf == 0:
s = 'WARNING: No labels found in %s. See %s' % (os.path.dirname(file) + os.sep, help_url)
print(s)
assert not augment, '%s. Can not train without labels.' % s

# Cache images into memory for faster training (WARNING: large datasets may exceed system RAM)
self.imgs = [None] * n

Loading…
취소
저장