how can i add more objects for recognition it the project?
To solve your problem, come take a look at this - Edge Impulse . This is free for a maker and will let you customise an already built Machine Learned system (like the Coco library used in this guide).
You will be able to get significantly higher FPS if you turn off the preview window. That will safe the Raspberry Pi a lot of processing power. Should be easy to locate the | Create Preview Window | section in the script and to comment them out.
Hopefully, that helps. I am exploring a AI camera right now (the Oak-D Lite) which will run machine learning scripts at a much higher FPS when attached to a Raspberry Pi. So stay tuned and give it a little looksie.
I think I’ve found the problem. When the rasp pi is detecting an object it’s lagging and will have a 3 seconds delay. How can I fix this?
Given the Pi is trying to compute everything in almost real-time there will be some delay(due to hardware-software interactions).
What use case do you have where you need an almost real-time detection?
A unit with a TPU(Tensor processing unit) assisting or doing the bulk of the work, will significantly decrease the delay.
FYI: Behind the scenes the Pi is capturing the image and turning the signal coming in on the CSI cable into a neat human-viewable video stream. Then crunching that stream through a complex neural-net (fancy statistics) then drawing that one your screen.
Quite an amazing process - to optimise this it will take a bit of work/money. some ideas: disable the viewing window on the Pi and cut back resources, you could tighten and train your own neural-net with less ‘neurons’, try other models/ methods of crunching those numbers.