fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.97k forks source link

resnet50_coco_best_v2.1.0.h5 model giving multiple outputs for same object #865

Closed Poonamjo closed 5 years ago

Poonamjo commented 5 years ago

Please make sure that you follow the steps below when creating an issue. Only use GitHub issues for issues with the implementation, not for issues with specific datasets or general questions about functionality. If your issue is an implementation question, please ask your question on the #keras-retinanet Slack channel instead of filing a GitHub issue. You can find directions for the Slack channel here: https://github.com/fizyr/keras-retinanet#discussions

Thank you!

  1. Check that you are up-to-date with the master branch of keras-retinanet.
  2. Check that you are up-to-date with the latest version of Keras: https://github.com/keras-team/keras.
  3. Check that you are up-to-date with the latest version of TensorFlow. The installation instructions can be found here: https://www.tensorflow.org/get_started/os_setup.
  4. Check that you have read the entire README.md: https://github.com/fizyr/keras-retinanet/README.md. Most noticably the FAQ section shows common issues: https://github.com/fizyr/keras-retinanet#faq.
  5. Clearly describe the issues you're having including the expected behaviour, the actual behaviour and the steps required to trigger the issue.
  6. Include relevant output from the commands you're executing, including full stack traces where relevant.
  7. Remove this entire message and replace it with your issue.
Poonamjo commented 5 years ago

getting output Using TensorFlow backend. 2019-01-07 19:02:21.757536: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 tv : 54.4662594795 tv : 90.4285371304 tv : 84.6153616905 tv : 69.2259967327

hgaiser commented 5 years ago

Can you describe more clearly what it is you did and what it is you're trying to do? What are the outputs that you shared?

Poonamjo commented 5 years ago

I am using the below code:

from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
detector.loadModel()
custom_objects = detector.CustomObjects(cell_phone=True,tv=True)
detections = detector.detectCustomObjectsFromImage(custom_objects=custom_objects,input_image=os.path.join(execution_path , "Living room picture 4.png"), output_image_path=os.path.join(execution_path , "Living room picture 4_new.jpg"),display_percentage_probability=False)
# detector.loadModel(detection_speed="fast")
for eachObject in detections:
    print(eachObject["name"] , " : " , eachObject["percentage_probability"] )

In the above code, I have the update the retinanet model from resnet50_coco_best_v2.0.1.h5 to resnet50_coco_best_v2.1.0.h5. and after running the code I am getting output

Using TensorFlow backend.
tv  :  54.46624755859375
tv  :  90.42854905128479
tv  :  84.61537957191467
tv  :  69.22597885131836

Process finished with exit code 0

it is not giving tv and cell_phone

hgaiser commented 5 years ago

Oh okay, you're using imageai. I hadn't seen that project yet, they appear to use our code. I can't support whatever it is they did. My advice is to ask the maintainers of imageai or to use our code.