For data visualization tasks in preparation for recording:
1. Get the picture data from the video
-
First, a specified length of the clip (2-3s) is effective fragment from video editing tools can be used directly (recommended fast clip)
-
The video clip into frames picture.
-
Right-view video clips of the first
属性
, then turn详细信息
to see帧速率
, this rate is an important parameter is the late-generated image. -
Tools can be used
ffmpeg
to generate images, can also be written directly script to complete the work. Here the use of the recordingffmpeg
operation of the process:Installation and configuration environment, see: https://blog.csdn.net/weixin_33895016/article/details/93944142
Use: video files into the directory,
shift + 右键
where openPowershell
, enter the command:-i ffmpeg " video.mp4 " -r 1 -q: v 2 -f image2 vid_% d.jpg # ffmpeg -i video frames per second -r -q: v picture quality parameters -f picture naming format
-
-
[Optional] rename the file. Needs to be generated above the file name changed to
000x.jpg, 00xx.jpg, 0xxx.jpg
the form, you can use the following script:def rename(file_path): """ It will give the image files in a given directory rename (0000.jpg format) :param file_path: :return: "" " # First of all the images obtained (List) Images = [] # Key X = the lambda: int (X [: -. 4]): '.' Backwards fourth number of the dividing line, in accordance with the left '.' numbers in ascending order (note logic here is written according to step 2 of vid_% d.jpg named above) for F in the sorted (the os.listdir (the os.path.join (file_path)), Key = the lambda the X-: int (the X-[4: -4])): # list obtained is out of order, remember what row sequence sub_path = os.path.join (file_path, f) IF os.path.isfile (sub_path): images.append(sub_path) print(images) # 重新命名 count = 0 for img in images: if count < 10: os.rename(img, os.path.join(file_path, '000' + str(count) + ".jpg")) elif count < 100: os.rename(img, os.path.join(file_path, '00' + str(count) + ".jpg")) elif count < 1000: os.rename(img, os.path.join(file_path, '0' + str(count) + ".jpg")) count += 1 print("rename completed!")
2. direct access to picture data
It's really nothing.
3. Photo Tagger
Here the main record windows
label at target detection data denoted format Pascal VOC
format. Similarly the rest of the system.
-
Must first select a data annotation tool, it recommended
labelme
. Not recommended online command-line installation, you can go here to download [extraction code: ldxp], there will be unpacked adata
folder and alabeme.exe
program.[Optional]
data
folder contains atxt
file, after which the object is used to configure the marked categories, you can pop category options when labeling without manual input. For example there area,b,c,d,e
five categories,txt
the following documents:
-
Direct open label
labelme.exe
can be. Click on the left sidebaropen Dir
to open the file that contains the data to import picture data, clickCreate RectBox
or use the shortcutw
to create a new callout box, finishedctrl+s
saved asxml
a file.
Reference: https://blog.csdn.net/weixin_33895016/article/details/93944142