You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Are setInputScale and setInputMean necessary ?
I'm currently testing this snippet and it works without them (I suppose these operation are already in the network model) while it does not work with them.. prediction is wrong (I suppose operation are doubled in this case)!
NOTE: considering discussion tensorflow/models#7727, only updated models work correctly: tensorflow/models#8057 NOTE: comparing to other SSD networks, these models expect normalized inputs ([-1, 1] input range):
@roccopietrini, Do you try the model from the model zoo or a custom one? Model ssd_mobilenet_v3_large_coco_2020_01_14 expects normalized input.
I tried with the model zoo model (ssd_mobilenet_v3_small_coco_2020_01_14), with just transfer learning for my custom class (so I just modified some parameters about the training in the pipeline.config, without any modification to the network). I generated the pbtxt file using this: https://github.com/opencv/opencv/blob/master/samples/dnn/tf_text_graph_ssd.py
I know the network expect normalized input, but I guess this is done by the network itself ? If I use setInputScale and setInputMea the prediction is wrong (the bounding box is much bigger), so I suspect the operations are doubled (because they already occur in the network..).
@roccopietrini, maybe something has been changed in the TensorFlow Object Detection API and published model does not reflect actual training code. Do you mind to open a separate issue so we won't miss it? Please add all the details - upload a newtork if possible, add origin image and expected results.
Hi, I don't think at this point that we have a bug in opencv .. so I'd better ask in stackoverflow because it's not fully clear to me weather the network include the normalization or not by default. I'll be back if I discover something .. :)
cv2.error: OpenCV(4.2.0) /io/opencv/modules/dnn/src/dnn.cpp:562: error: (-2:Unspecified error) Can't create layer "FeatureExtractor/MobilenetV3/Conv/hard_swish/add" of type "AddV2" in function 'getLayerInstance'
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Readiness Checklist
Merge with extra: opencv/opencv_extra#725
Add support for MobileNetV3 SSD from TensorFlow Object Detection API: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md#mobile-models
Follow a guide to run the model: https://github.com/opencv/opencv/wiki/TensorFlow-Object-Detection-API
NOTE: considering discussion tensorflow/models#7727, only updated models work correctly: tensorflow/models#8057
NOTE: comparing to other SSD networks, these models expect normalized inputs (
[-1, 1]
input range):