Neural Network realtime Instance Segmentation from Video - neural-network

I'm new to this whole neural network stuff, and for my first project I'd like to detect a car moving trough the frame. So far I found the cocodataset and YOLO object detection.
What I'm think I'm after is Object/Instance Segmentation, so I can define a region of Interest inside my view and then check for overlap with the Instance segment. As soon as a certain area is reached I can use that information as a trigger.
I guess as soon as I have the classified instance outline the geometrical stuff shouldn't be the issue, but for now I don't know if this is possible.
Has this been done, is there some example code (preferably in some "lazy" language as python, js). Is this currently possible in realtime at all? Do I have any chance to run this on a modern smartphone?

Related

Density Maps for Materials moving along Conveyors in Anylogic

I'd like to show congestion areas on a conveyor network by using the density map included into the Material Handling Library, but so far I haven't find a way to do so, as material agents movement cannot be tracked by the density map, but it only accepts transporters or pedestrians (both in free space movement mode).
So I thought I could create a "parallel" agent (for instance, a pedestrian) that could get attached to my material and move along with it. Then I could set the pedestrian visible property to "no" so that it does not show in the animation, or make it really small as an alternative approach.
The problem when doing the pickup/dropoff logic is that the pedestrian disappears from the scene when it gets picked up (although it's internally batched with the material) so the density map shows nothing.
Same thing happens if I try to seize/release a transporter, as they do not travel along the conveyor with the material agent.
Any idea on how to get this?
Thanks a lot in advance!
You won't be able to drag pedestrians, they actively move via PedMoveTo blocks. This is a creative idea but it will not work.
You will have to code your own heatmap using dynamically colored rectangles that you animate on top of conveyors. Doable, but might be more work than is really required for your purpose ;)

Troubleshooting in case of tracking loss

I created an Object to Play Animation through the HelloAR Example of ARCore. Then he covered Camera with his hand and caused a tracking loss.
And if you shine the space again, the object you create will return, but the Animation will start from the beginning.
If space is recognized again after the tracking loss occurs, sometimes the object is returned but not returned. Is there a way of distinguishing?
If you recognize space again after a tracking loss occurs, why does Animation start all over again when the object returns? Are you deleting and recreating the object?
ARCore uses a techniques called Visual Inertial Odometry. It is a hybrid techniques which combine computer vision and sensor fusion.
So what VIO does is it combines data extracted from feature points(corners, blobs, edges, etc) with data acquired from mobile device IMU unit. It is crucial in ARCore you know the position of your device. Because you estimate every trackable position based on this information(triangulation using device pose).
Also another aspect is ARCore builds a sparse map of the environment while you move in the room. So those extracted feature points are stored in the memory based on a confidence level and used later to localize device.
At last, what happens when tracking is lost is you can not extract feature points due to a while wall for example. When you can not extract feature points you can not localize the device. Therefore, device does not know where it is in this Sparse map i mentioned above. Sometimes you recover because you go back to the places which are already scanned and kept in this Sparse map.
Now for your questions:
If you anchor your objects. Your objects will return but there can be drifts because ARCore can accumulate errors during this process especially if you move during device tracking is lost. So probably they return but they are not at the same physical position anymore because of the drifts.
As in animation restarting since those anchors can not be tracked they deactivated. Also since you anchor your objects they are child of the anchor so your objects are deactivated as well. That is why your animation restart.
You can test both issues using instant preview and see what happens to anchors when you lose tracking. Good luck!

Model lost on uniform background surface with ARCamera (Vuforia, Unity)

I'm trying to use Vuforia in Unity to see a model in AR. It is working properly when I'm in a room with lost of different colors, but if I go in a room with one single color (example : white floor, white wall, no furniture), the model keeps disappearing. I'm using Extended tracking with Prediction enabled.
Is there a way to keep the model on screen whatever the background seen by webcam?
Is there a way to keep the model on screen whatever the background seen by webcam??
I am afraid this is not possible. Since vuforia uses Markerless Tracking it requires high contrast on the points.
Since most of AR SDKs only use a monocular RGB camera (not RGB-Depth), they rely on computer vision techniques to calculate missing depth information. It means extracting visual distinct feature points and locating device using estimated distance to these feature points over several frames while you move.
However, they also leverage from sensor fusion which means they combine data gathered from camera and the data from IMU unit(sensors) of the device. Unfortunately, this data is mainly used for complementing when motion tracking fails in situations like excessive motion(when camera image is blurred). Therefore, sensor data itself is not reliable which is the case when you walk into a room where there are no distinctive points to extract.
The only way you can solve this is by placing several image targets in that room. That will allow Vuforia to calculate device position in 3D space. Otherwise this is not possible.
You can also refer to SLAM for more information.

Neural network input layer for a game with variable sized state

I (think I) can understand how the inputs may be structured for a neural network playing a game like chess or go where the next action of the player depends on inputs of a fixed size. However there are simpler games where the state visible to the player is of a variable size (i.e. in the case of uno, a simple card game, the player may have any number of cards in their hand, and the next move may depend on the cards that have already been played of which there is no set amount).
Are these types of games incompatible with a neural network? If not, what might the input layer look like? And if so, what are the alternatives?
You can implement everything you want with Neural Networks/Expert systems/AI, but what you have to consider if this is the better tool to do the job.
When you work with this kind of approach the problem in most of the cases is how to encode the input in a proper way to archive the best result when you evaluate your AI.
Yes, you can implement chess and uno with AI, but you have to think first on how you can code your inputs and on how you think when you play the game.
Doing this with AI it's much more difficult than use a traditional approach.
If you google implement Chess AI you will find a few implementations, some using electromagnetic field intensity, other one using functions to rank moves.
The question is what you want to archive, a game developed with an AI or to code a good chess game?.
Do you want to use the tool because it's cool or because you think that it can fit on the problem context

How to find contours of soccer player in dynamic background

My project is a designation for a system which analyze soccer videos. In a part of this project I need to detect contours of players and everybody in the play field. For all players which don’t have occlusion with the advertisement billboards, I have used the color of play field (green) to detect contours and extract players. But I have problem with the situation that players or referee have occlusion with the advertisement billboards. Suppose a situation that advertisements on the billboards are dynamic (LED billboards). As you know in this situation finding the contours is more difficult because there is no static background color or texture. You can see two example of this condition in the following images.
NOTE: in order to find the position of occlusion, I use the region between the field line and advertisement billboards, because this region has the color of the field (green). This region is shown by a red rectangular in the following image.
I expect the result be similar to the following image.
Could anyone suggest an algorithm to detect these contours?
You can try several things.
Use vision.PeopleDetector object to detect people on the field. You can also track the detected people using vision.KalmanFilter, as in the Tracking Pedestrians from a Moving Car example.
Use vision.OpticalFlow object in the Computer Vision System Toolbox to compute optical flow. You can then analyze the resulting flow field to separate camera motion from the player motion.
Use frame differencing to detect moving objects. The good news is that that will give you the contours of the people. The bad news is that it will give you many spurious contours as well.
Optical Flow would work for such problems as it captures motion information. Foreground extraction techniques using HMM or GMM or non-parametric may solve the problem as I have used for motion analysis in surveillance videos to detect anomaly (Background was static). Magnitude and orientation of optical flow seems to be an effective method. I have read papers on segmentation using optical flow. I hope this may help you.