The process of constructing a dataset
Video file >> ffmpeg processing >> image set >> labelImg for labeling >> labelled dataset
prepare ffmpeg
Download through the official download address and choose according to your machine type
Unzip the downloaded archive (I renamed the file for convenience)
>>>>>>>>>>>>>
Add the bin directory under ffmpeg to the path of the system (the specific process of configuring environment variables is not repeated here ^^)
Enter the following command in Windows DOS to verify that the environment variables are configured
ffmpeg -v
The results obtained are as follows, indicating that ffmpeg can be used
Use ffmpeg to take video frames, first enter the folder where the video is stored
Then enter powershell and enter the command to take video frames. The format of the command is roughly: ffmpeg -i video -r frames per second -q:v picture quality parameter -f picture naming format (for more usage, ask Du Niang ^^)
ffmpeg -i "video.mp4" -r 1 -q:v 2 -f image2 vid_%d.jpeg
Get the extracted frame picture after carriage return
Install PyQt4 and lxml under the condition that python2.7 is installed and environment variables are configured and pip is installed and environment variables are configured
Install lxml, enter the command in DOS, and it will be downloaded and installed automatically after pressing Enter
pip install lxml
After the installation is complete, enter python and enter
import lxml
Get the result of the following figure, python does not report an exception, indicating that the installation is successful
Install PyQt4, click the download link to download, and download according to your needs
After the download is complete, double-click to install, all the way to next until the installation is complete
Download the open source labelImg on github, the address is here
After downloading, unzip it, and get a folder named: labelImg-master. According to your own needs, open the predefined_classes.txt file in the data file to set the label (I set it as bald head strong, Xiong Da, Xiong Er)
Enter powershell in the labelImg-master file
Execute the code first
pyrcc4 -o resources.py resources.qrc
then execute the code
python labelImg.py
Now you can roll up your sleeves and annotate pictures, there are open folders or open a picture (here I will never say it must be named in English )
Mark one and take a look (the video quality is poor, the picture is not particularly clear, just an example ^^)
---End of recovery content---