Giter VIP home page Giter VIP logo

Comments (5)

OlafenwaMoses avatar OlafenwaMoses commented on May 12, 2024

Hello, did you ensure you downloaded the correct model file, set the correct model type and set the correct model path to the model file you downloaded? Ensure all of this is done before running your python code.

from imageai.

Airyzf avatar Airyzf commented on May 12, 2024

This is python code, resnet50_coco_best_v2.0.1.h5 model file in models folder

from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
model_path = os.path.join(execution_path, "models\resnet50_coco_best_v2.0.1.h5")
print("model path : {}".format(model_path))

detector.setModelPath(model_path)

img_path = os.path.join(execution_path, "image\5.jpg")
print("img path : {}".format(img_path))

detector.loadModel()

detections = detector.detectObjectsFromImage(input_image=img_path,
output_image_path=os.path.join(execution_path, "image2new.jpg"))

for eachObject in detections:
print(eachObject["name"] + " : " + eachObject["percentage_probability"])
print("--------------------------------")``

from imageai.

OlafenwaMoses avatar OlafenwaMoses commented on May 12, 2024

Please see discussion here #30

from imageai.

Airyzf avatar Airyzf commented on May 12, 2024

ok,thanks

from imageai.

kushu9999 avatar kushu9999 commented on May 12, 2024

i got this type of error anyone knows how to solve please tell me i searching about it's solution lasst 3 days , i applied all things but it didn't solved

TypeError Traceback (most recent call last)
in ()
83 (boxes, scores, classes, num) = sess.run(
84 [detection_boxes, detection_scores, detection_classes, num_detections],
---> 85 feed_dict={image_tensor: frame_expanded})
86
87 # Draw the results of the detection (aka 'visulaize the results')

2 frames
/usr/local/lib/python3.6/dist-packages/numpy/core/_asarray.py in asarray(a, dtype, order)
83
84 """
---> 85 return array(a, dtype, copy=False, order=order)
86
87

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

from imageai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.