Skip to content

CV_skeleton_provider project made for detecting a skeleton structure easily. It is distributed via pypi package.

License

Notifications You must be signed in to change notification settings

LiiNen/CV_skeleton_provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CV_skeleton_provider

LISENCE release release_date last_commit dependency contributors
pypi python implementation wheel

OpenCV Project

CV_skeleton_provider project made for detecting a skeleton structure easily.
This project contains how to use pretrained models and analize video with frames, using openCV.
For solving some discomports, we make it from the beginning and providing argparse to use it easily.
Also providing img preprocessing methods, you can use it with simple options when you use specific imgs

How to use

! prototxt file & caffemodel file are not included in both pypi package & project
! you should download these pre-trained models in website, and you can easily find it

using pip package (recommended)

  1. install pypi package
$ pip install CV_skeleton_provider
  1. python code
from CV_skeleton_provider.SkeletonProvider import defaultDict, skprovider
skprovider(defaultDict()) # show skeleton image over default img
  1. custom parameter (when customizing)
input_dict = defaultDict()
input_dict['source']       =  './example.jpeg'   # input filepath. img(jpg, jpeg, png) or video(mp4, avi, mkv) supported
input_dict['output']       =  './output'         # output filepath(exclude format). file format will be set by automatically.
input_dict['option']       =  'skl'              # s for skeleton, k for keypoints, l for label. if string include these char, show it
input_dict['exclude']      =  []                 # 0~17 interger list. that point will not be shown on result.
input_dict['thres']        =  0.1                # threshold (float)
input_dict['gray']         =  False              # using grayscale (bool)
input_dict['back']         =  False              # remove background (bool)
input_dict['selectRect']   =  False              # when removing background, you can set the object(human) size by drag img (bool)
input_dict['autolocation'] =  False              # when removing background, code will automatically 'detect' human (bool)
input_dict['comp']         =  1                  # for only video. video frame will be reduced to 1/comp (int)
input_dict['gamma']        =  -1                 # img preprocessing gamma value. under 0 means not processing gamma (float)
input_dict['b_propo']      =  False              # check black proportion and preprocessing reducing black part (bool)
input_dict['show']         =  False              # (only for img) if you want to show img with cv2.imshow, set to True (bool)
input_dict['save']         =  True               # (only for img) if you want not to save file in local, set to False (bool)
input_dict['proto']        =  './pose/coco/pose_deploy_linevec.prototxt'    # prototxt filepath
input_dict['weight']       =  './pose/coco/pose_iter_440000.caffemodel'     # caffemodel filepath
skprovider(input_dict)

using clone project

$ git clone https://github.com/LiiNen/CV_skeleton_provider.git
$ pip install -r ./CV_skeleton_provider/requirements.txt
$ cd ./CV_skeleton_provider/CV_skeleton_provider
$ python ./SkeletonProvider.py # show skeleton image over default img

you can use argparse with SkeletonProvider.py to change parameter
check it with following command in CLI

$ python SkeletonProvider.py --help

! as mentioned, prototxt & caffemodel must be existed. followings are default path

./CV_skeleton_provider/CV_skeleton_provider/pose/coco/pose_deploy_linevec.prototxt
./CV_skeleton_provider/CV_skeleton_provider/pose/coco/pose_iter_440000.caffemodel

Processing Examples (improve detecting accuracy)

using black proportion

origin input origin output black proportion output

using background removing

origin input origin output background removed

setting gamma value

origin input origin output gamma 0.8 output

movie test (device iPhone SE2, 30fps)

Main contributors

GithubContact

About

CV_skeleton_provider project made for detecting a skeleton structure easily. It is distributed via pypi package.

Topics

Resources

License

Stars

Watchers

Forks

Languages