This commit is contained in:
Glenn Jocher 2019-09-10 11:52:27 +02:00
parent c1ad7e6c2b
commit 10b080d90c
1 changed files with 2 additions and 3 deletions

View File

@ -613,8 +613,7 @@ def select_best_evolve(path='evolve*.txt'): # from utils.utils import *; select
# Find best evolved mutation # Find best evolved mutation
for file in sorted(glob.glob(path)): for file in sorted(glob.glob(path)):
x = np.loadtxt(file, dtype=np.float32, ndmin=2) x = np.loadtxt(file, dtype=np.float32, ndmin=2)
fitness = x[:, 2] * 0.5 + x[:, 3] * 0.5 # weighted mAP and F1 combination print(file, x[fitness(x).argmax()])
print(file, x[fitness.argmax()])
def coco_single_class_labels(path='../coco/labels/train2014/', label_class=43): def coco_single_class_labels(path='../coco/labels/train2014/', label_class=43):
@ -693,7 +692,7 @@ def print_mutation(hyp, results, bucket=''):
def fitness(x): def fitness(x):
# Returns fitness (for use with results.txt or evolve.txt) # Returns fitness (for use with results.txt or evolve.txt)
return 0.50 * x[:, 2] + 0.50 * x[:, 3] # fitness = 0.5 * mAP + 0.5 * F1 return x[:, 2] * 0.5 + x[:, 3] * 0.5 # weighted mAP and F1 combination
# Plotting functions --------------------------------------------------------------------------------------------------- # Plotting functions ---------------------------------------------------------------------------------------------------