question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to use your scripts to generate my own anchor sizes and scales?

See original GitHub issue

Dear Sir: I have some problem to understand your cluster_bbox_sizes.py, optimize_bboxes.py and bbox_recall.py. I really want use them to set the parameters: scales aspect_ratios and conv_sizes more reasonable. Could you please explain a little of what these means? Thanks a lot!

I use the default paras as the yolact_base.cfg does, and test the scripts on a dataset scales = [ [24],[48],[96],[192],[384] ] aspect_ratios = [ [[1, 1/sqrt(2), sqrt(2)]] ]*5 conv_sizes = [(69, 69), (35, 35), (18, 18), (9, 9),(5,5)] here are the results: from: cluster `0.062 (18) aspect ratios: 17.71 (8) 5.23 (8) 109.76 (2)

0.146 (70) aspect ratios: 4.39 (34) 2.26 (30) 0.65 (6)

0.241 (125) aspect ratios: 1.12 (103) 0.23 (21) 0.00 (1) `

from optimize_bbox:

`(Iteration 9) Aspect Ratios: [[[19.03, 0.55, 1.13]], [[13.94, 13.64, 14.24]], [[13.94, 13.64, 14.24]], [[13.94, 13.64, 14.24]], [[13.94, 13.64, 14.24]]]

scales = [[17.53], [60.94], [108.94], [204.94], [396.94]]

aspect_ratios = [[[19.03, 0.55, 1.13]], [[13.94, 13.64, 14.24]], [[13.94, 13.64, 14.24]], [[13.94, 13.64, 14.24]], [[13.94, 13.64, 14.24]]] `

from bbox_recall:

`Total recall: 33.80

small recall: 0.00 medium recall: 0.00 large recall: 46.75 `

Thanks a lot! It’s a bit hard for me >o<

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dbolyacommented, May 15, 2019

Actually those aren’t square (at least well they’re not supposed to be). Aspect ratio means the ratio between width and height. So an aspect ratio of sqrt(2) means that the width is sqrt(2) times the height (i.e., w/h = sqrt(2)). I realized I had a bug while implementing this (see #19) which resulted in the width and height set to the same number (equal to what the width should have been). For paper reproducability reasons, I’m keeping the bug in until we release v1.1, but if you want to fix it yourself, change this line: https://github.com/dbolya/yolact/blob/ad167c0a72169b68a0e68ea7bcd0e6b0b9e53834/yolact.py#L266 to: scale / ar / cfg.max_size

Then by P-R you mean the precision-recall curve? I don’t have a script to plot that, but you can find the precisions and recalls here if you want to plot them yourself: https://github.com/dbolya/yolact/blob/ad167c0a72169b68a0e68ea7bcd0e6b0b9e53834/eval.py#L498

And go ahead and try to implement YOLACT in YOLO if you’d like. Let me know if you get some good results!

Also, I’ve updated the clustering script. To use, run python scripts/save_bboxes.py from the root YOLACT directory, which will save a numpy array of all the bounding boxes in the 2017 COCO training set. Once you have that run python scripts/cluster_bbox_sizes.py and it’ll output 5 suggested bounding box scales, along with 3 aspect ratios for each scale. To use those scales and aspect ratios, simply replace https://github.com/dbolya/yolact/blob/fd84079b53e2325b5bb451a0029736f20cbee0ed/data/config.py#L590 with the scales it gives and https://github.com/dbolya/yolact/blob/fd84079b53e2325b5bb451a0029736f20cbee0ed/data/config.py#L589 with the aspect ratios ([ [[scale1_ar1, scale1_ar2, scale1_ar3]], [[scale2_ar1, scale2_ar2, scale2_ar3]], etc. ])

1reaction
dbolyacommented, May 14, 2019

optimize_bboxes.py was a test that unfortunately never ended up working (instead of clustering scales and aspect ratios, how about we try to directly optimize the recall?) The scales and aspect ratios it produces result in much worse performance.

cluster_bbox_sizes.py is the standard approach, but it hasn’t been updated for a very long time so is completely broken (it looks like it’s suggesting aspect ratios of 17.7 and 109.6 which are a little on the absurd side).

I can update cluster_bbox_sizes.py if you’d like, but I should probably get rid of optimize_bboxes.py.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Size and anchors - Godot Docs
Instead of manually adjusting the margin and anchor values, you can use the toolbar's Layout menu, above the viewport. Besides centering, it gives...
Read more >
How to scale text perfectly (solved) - Scripting Support
I'd recommend making use of AnchorPoints and using constraints like UIAspectRatioConstraint and UIPadding to get the proper sizing and scaling ...
Read more >
Optimize GitLab CI/CD configuration files
You can't use YAML anchors across multiple files when using the include keyword. ... .job_template configuration, each with their own custom script defined:....
Read more >
How to scale, shear, and distort objects in Illustrator
Learn about scaling, shearing, and distorting objects using various tools ... Therefore, you cannot resume the original size of the object.
Read more >
scale() - CSS: Cascading Style Sheets - MDN Web Docs
Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found