pip install progressbar2,lxml,opencv-python
Do note this step needs Python3
for Chinese encoding.
1_convert.py
is written for YuShi Cameras to create folder and structures same as the other system.
python3 1_convert.py --yushi /path/to/yushi/video/root
2_rename_raw.py
rename all folders in the form ofLXMXCXX
according tolistfile
:
python3 python 2_rename_raw.py --root /path/to/video/root --listfile /path/to/list/file(default:Camlist.txt)
3_rmfile_new.py
will rearrange previous image folders of structure cam-time
for easier labeling distribution to the structure of date-lane-time-cam
python 3_rmfile_new.py --source /path/to/image/root --target /path/to/target/image/root
4_video2image_sep.py
will traverse all videos under video
and crop images to exact same dir structure under image
python 4_video2image_sep.py --video /path/to/video/root --image /path/to/image/root
5_fpscount.py
will help check all images for each video clip to see if the cropping is performed right(this might not be supported bypython3
)
python 5_fpscount.py --image /path/to/image/root --file /file/name(default:imagecounts.txt)
within generated file
default under path/to/image/root
, one can estimate whether image numder is right according to its corresponding time period
- if whole video is cropped incorrectly, use
6_fps.py
:
python 6_fps.py --video /path/to/video.mp4(ts) --stride 1
- if only part of the video is cropped incorrectly, say after
number
images, use7_fps_part.py
python 7_fps_part.py --video /path/to/video.mp4(ts) --resume number
- Results will be put in a folder sharing the same location and name with video, do check again! If you use
7_fps_part.py
, don't forget to use8_rename_part.py
to rename all images
python 8_rename_part.py -folder /path/to/video
- Manually move this folder to desired location under
/path/to/image/root/
9_demo_batch_new.py
will traverse all images under image
and create xml files storing all results accordingly.
cd $Faster-RCNN$/tools
source activate fasterrcnn
python 9_demo_batch_new.py --model ../model/VGGnet_fast_rcnn_iter_70000.ckpt --image /path/to/target/image/root
Zip according to date and distribute for labeling.
10_xml2pedestrain.py
will traverse all xml files collected labeling by id
and extract pedestrains
python 10_xml2pedestrain.py --image /path/to/target/image/root --id id --target target/folder/name(default:dataset)
11_labelsum.py
will summarize the labeling output.
python 11_labelsum.py --root /path/to/image/root --id id
It will output two files under /path/to/image/root
, namely counts.txt
and results.txt
. counts.txt
tells ids captures by different numbers of cameras, and results.txt
tells the detailed information for each id.
!IT WILL REPLACE ORIGINAL IMAGE, PLEASE BACK UP FIRST!
12_resize.py
will resize all images under path/to/image/root
to a fixed size, default to 64*128
python 12_resize.py --root /path/to/image/root --id id
This may see to an update for imporved experinece, avoid using for now!