Open Zonsor opened 6 years ago
The amount of classes you train on is not related to how many objects (of the same class) the classifier can detect in your image, neither is the amount of objects per training image. Try training on a larger dataset with a bigger variety in pose/size of the license plates and see if it improves on the detections. What you can also do is reduce the threshold when testing your model to increase the predicted bounding boxes.
@LDSt Thank you for your advice, I will try it. And I forgot that tfnet.return_predict(img) returns a list. I just use one index on result. So when I detect the images, It only shows one result.
@Zonsor Were you able to get it working? I'm getting a similar error as seen below with sand boils. I trained on 948 images, do I need to train on more images? @LDSt I tried lowering my threshold and it does give me more boxes but most of them are incorrect, is there another option I can change?
Thanks
@kevin9kai Yeah! it works. And the reason is that I forgot that tfnet.return_predict(img) returns a list. So maybe you should notice the length of the list, or lower the threshold to get more results.
@Zonsor Congrats on getting it working! what is the tfnet.return_predict(img) you are talking about? Is it a command, part of the code or something else? So I tried lowering the threshold but then I would get more labels/boxes but they would be all over the place, does that mean I don't have enough training data?
Thanks for the reply
@kevin9kai tfnet.return_predict(img) is a piece of the code used to run Darkflow from a separate python program. It returns a list of results containing at least confidence and coordinates. Below is the official example on how to use it.
from darkflow.net.build import TFNet
import cv2
options = {"model": "cfg/yolo.cfg", "load": "bin/yolo.weights", "threshold": 0.1}
tfnet = TFNet(options)
imgcv = cv2.imread("./sample_img/sample_dog.jpg")
result = tfnet.return_predict(imgcv)
print(result)
As title, I use yolov2-tiny to detect license plate. There are more than one plate in the images. But YOLO just detect one plate.
I set class=1 to only detect plate. And I only have few train data which have more than one plate. Is it the reason for that?