Correct mutation adding the missing parameters (#11109)

* Correct mutation adding the missing parameters

Correct mutation considering the higher number of segmentation parameters compared to object detection.

Fixes #9730

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>

* Use already defined segmentation keys from segment/metrics.py

---------

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Iker LluviaandGlenn Jocher authored and GitHub committed 2023-03-09 23:47:53 +01:00
1 parent 85f6019e5a
commit ea05d5cb6c
1 file changed
+2 -2
+2 -2
View File
@@ -629,7 +629,7 @@ def main(opt, callbacks=Callbacks()):
while all(v == 1): # mutate until a change occurs (prevent duplicates)
v = (g * (npr.random(ng) < mp) * npr.randn(ng) * npr.random() * s + 1).clip(0.3, 3.0)
for i, k in enumerate(hyp.keys()): # plt.hist(v.ravel(), 300)
hyp[k] = float(x[i + 7] * v[i]) # mutate
hyp[k] = float(x[i + 12] * v[i]) # mutate
# Constrain to limits
for k, v in meta.items():
@@ -641,7 +641,7 @@ def main(opt, callbacks=Callbacks()):
results = train(hyp.copy(), opt, device, callbacks)
callbacks = Callbacks()
# Write mutation results
print_mutation(KEYS, results, hyp.copy(), save_dir, opt.bucket)
print_mutation(KEYS[4:16], results, hyp.copy(), save_dir, opt.bucket)
# Plot results
plot_evolve(evolve_csv)