Skip to content

Commit

Permalink
Correct mutation adding the missing parameters (ultralytics#11109)
Browse files Browse the repository at this point in the history
* Correct mutation adding the missing parameters

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

Fixes ultralytics#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>
  • Loading branch information
2 people authored and Smfun12 committed Mar 24, 2023
1 parent 623b320 commit f9823df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions segment/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)
Expand Down

0 comments on commit f9823df

Please sign in to comment.