-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another Anchor Box Question #439
Comments
Thought I would post this since the following steps worked for me:
After doing all of the above it worked and results improved significantly. Thanks for your site! |
@suchiek i get the error NameError: name 'backbone' is not defined after doing step 3. How did you resolve this? |
@elinevandeven: That was probably fixed yesterday by #479. |
@suchiek Hi, did you add more ratios and scales or just change the value? |
All the mentioned changes above are for what version of keras_retiananet? @suchiek |
Hi @shivareddy37, For the latest retinanet, I think you dont need to apply step 3, I tried with step 1 and 2, and it worked. |
I have another question the scales and ratios are based on your annotations or image size . You you mind sharing the values you used ? @suchiek |
Hi @shivareddy37, you are @ the wrong person lol. Anyways, it's based on the size of my objects. Because some of my objects are very elongated. So I add ratios up to 14:1. But I didn't change scales. And it seems to work. |
hey @IntelligentIndia7 or anyone who can shine some light! I was wondering, for the latest retinanet version, is there anything else to do to change the anchor ratios more than editing the default anchor params at |
Hi,
I read through all the questions regarding modifying anchor boxes. I have a long narrow object along with several others that I am trying to detect. So far, the model is doing well on all except the long narrow one. I am trying to modify the anchor boxes to get it to detect this object.
Based on past discussions, it appears that there a few places where modifications need to be made.
****def generate_anchors(base_size=16, ratios=None, scales=None):
anchor_parameters = keras_retinanet.models.retinanet.AnchorParameters(
sizes = [32, 64, 128, 256, 512],
strides = [8, 16, 32, 64, 128],
ratios = np.array([0.5, 1, 2], keras.backend.floatx()), # Change this for your ratios
scales = np.array([2 ** 0, 2 ** (1.0 / 3.0), 2 ** (2.0 / 3.0)], keras.backend.floatx()), # Change this for your scales
)
model = model_with_weights(backbone_retinanet(num_classes, backbone=backbone, modifier=modifier, anchor_parameters=anchor_parameters), weights=weights, skip_mismatch=True)
After doing the above, I am still getting an error message:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,120087,4] vs. [1,320232,4]
Please let me know if I missed something.
thanks for all your responses and help.
The text was updated successfully, but these errors were encountered: