pedropro / TACO

🌮 Trash Annotations in Context Dataset Toolkit
http://tacodataset.org
MIT License
599 stars 201 forks source link

Inference on a NON annotated custom dataset #21

Open ysig opened 4 years ago

ysig commented 4 years ago

I have all sorts of problems trying to simplify the code, so I can do inference on a custom dataset with NO annotations. Is there an easy way you can do so?

Thanks

LucaArietti commented 3 years ago

I have the same issue. I want to use this detector on custom immage not annotated, but I have problems running the code.

deandiakov commented 3 years ago

A quick and dirty method is to go inside of the test_dataset method loop in detector.py and load in your own image from somewhere in the folder, convert to numpy, and then pass into the model:

        img = Image.open('./original.jpg')
        # convert image to numpy array
        data = np.asarray(img)
        r = model.detect([data], verbose=0)[0]

The results contain the bounding box and mask info which you can then use yourself. Or you can pass data into the visualizers as the first argument.

LucaArietti commented 3 years ago

thanks @deandiakov it works