<p>PyTorch at the moment doesn't have <a href="https://pytorch.org/docs/stable/torchvision/io.html" rel="nofollow noreferrer">support to detect and track objects</a> in a video. </p>

<p>You would need to create your own logic for that.</p>

<p>The support is limited to read the video and audio from a file, read frames and timestamps, and write the video read more in <a href="https://pytorch.org/blog/pytorch-1.2-and-domain-api-release/#torchvision-04-with-support-for-video" rel="nofollow noreferrer">here</a>.</p>

<p>What you will basically need to do is to create an object tracking, frame by frame together by keeping their with their square positions and based on that decide if the same object or not.</p>

<p>If you have a drone flying and inspecting people you may check <a href="https://deepmind.com/research/open-source/kinetics" rel="nofollow noreferrer">Kinetics</a> to detect human actions:</p>

<ul>
<li>ResNet 3D 18</li>
<li>ResNet MC 18</li>
<li>ResNet (2+1)D</li>
</ul>

<p>All based on <a href="https://arxiv.org/abs/1711.11248" rel="nofollow noreferrer">Kinetics-400</a>
But the newer one is <a href="https://arxiv.org/abs/1907.06987" rel="nofollow noreferrer">Kinetics-700</a>.</p>
Applying a pytorch CNN to video?
<p>I am looking for some advice on how to apply a pytorch CNN to a video as opposed to an image.  </p>

<p>Picture a drone flying over an area and using video to capture some objects below. I have a CNN trained on images of objects, and want to count the objects in the video.  </p>

<p>Currently my strategy has been to convert the video to frames as PNGs and running the CNN on those PNGs. this seems inefficient, and I am struggling with how to count the objects without duplicating (frame 1 and frame 1+n will overlap).  </p>

<p>It would be appreciated if someone had some advice, or a suggested tutorial/code set that did this.  Thanks in advance.  </p>