Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update latest version. #1

Merged
merged 6 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions alphapose/utils/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def vis_frame_dense(frame, im_res, add_bbox=False, format='coco'):
cv2.rectangle(img, (int(bbox[0]), int(bbox[2])), (int(bbox[1]), int(bbox[3])), BLUE, 2)
# Draw indexes of humans
if 'idx' in human.keys():
cv2.putText(img, ''.join(str(e) for e in human['idx']), (int(bbox[0]), int((bbox[2] + 26))), DEFAULT_FONT, 1, BLACK, 2)
cv2.putText(img, ''.join(str(human['idx'])), (int(bbox[0]), int((bbox[2] + 26))), DEFAULT_FONT, 1, BLACK, 2)
# Draw keypoints
for n in range(kp_scores.shape[0]):
if kp_scores[n] <= 0.35:
Expand Down Expand Up @@ -167,7 +167,7 @@ def vis_frame_fast(frame, im_res, add_bbox=False, format='coco'):
cv2.rectangle(img, (int(bbox[0]), int(bbox[2])), (int(bbox[1]), int(bbox[3])), BLUE, 2)
# Draw indexes of humans
if 'idx' in human.keys():
cv2.putText(img, ''.join(str(e) for e in human['idx']), (int(bbox[0]), int((bbox[2] + 26))), DEFAULT_FONT, 1, BLACK, 2)
cv2.putText(img, ''.join(str(human['idx'])), (int(bbox[0]), int((bbox[2] + 26))), DEFAULT_FONT, 1, BLACK, 2)
# Draw keypoints
for n in range(kp_scores.shape[0]):
if kp_scores[n] <= 0.35:
Expand Down Expand Up @@ -245,7 +245,7 @@ def vis_frame(frame, im_res, add_bbox=False, format='coco'):
# Draw indexes of humans
if 'idx' in human.keys():
bg = img.copy()
cv2.putText(bg, ''.join(str(e) for e in human['idx']), (int(bbox[0] / 2), int((bbox[2] + 26) / 2)), DEFAULT_FONT, 0.5, BLACK, 1)
cv2.putText(bg, ''.join(str(human['idx'])), (int(bbox[0] / 2), int((bbox[2] + 26) / 2)), DEFAULT_FONT, 0.5, BLACK, 1)
transparency = 0.8
img = cv2.addWeighted(bg, transparency, img, 1 - transparency, 0)
# Draw keypoints
Expand Down
5 changes: 4 additions & 1 deletion docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ python setup.py build develop --user
```

#### Windows
Windows users should install Visual Studio due to the problem mentioned [here](https://github.com/MVIG-SJTU/AlphaPose/blob/master/setup.py#L121).
If you do not want to install Visual Studio and want to use AlphaPose, you can refer to our [previous version](https://github.com/MVIG-SJTU/AlphaPose/tree/pytorch#installation) that do not require Visual Studio.

For Windows user, if you meet error with PyYaml, you can download and install it manually from here: https://pyyaml.org/wiki/PyYAML.
If your OS platform is `Windows`, make sure that Windows C++ build tool like visual studio 15+ or visual c++ 2015+ is installed for training.

Expand Down Expand Up @@ -99,4 +102,4 @@ Download and extract them under `./data`, and make them look like this:
|-- 036645665.jpg
|-- 045572740.jpg
|-- ...
```
```
67 changes: 33 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,42 +118,41 @@ def make_cuda_ext(name, module, sources):

def get_ext_modules():
ext_modules = []
# only windows visual studio 2013~2017 support compile c/cuda extensions
# only windows visual studio 2013+ support compile c/cuda extensions
# If you force to compile extension on Windows and ensure appropriate visual studio
# is intalled, you can try to use these ext_modules.
if platform.system() != 'Windows':
ext_modules = [
make_cython_ext(
name='soft_nms_cpu',
module='detector.nms',
sources=['src/soft_nms_cpu.pyx']),
make_cuda_ext(
name='nms_cpu',
module='detector.nms',
sources=['src/nms_cpu.cpp']),
make_cuda_ext(
name='nms_cuda',
module='detector.nms',
sources=['src/nms_cuda.cpp', 'src/nms_kernel.cu']),
make_cuda_ext(
name='roi_align_cuda',
module='alphapose.utils.roi_align',
sources=['src/roi_align_cuda.cpp', 'src/roi_align_kernel.cu']),
make_cuda_ext(
name='deform_conv_cuda',
module='alphapose.models.layers.dcn',
sources=[
'src/deform_conv_cuda.cpp',
'src/deform_conv_cuda_kernel.cu'
]),
make_cuda_ext(
name='deform_pool_cuda',
module='alphapose.models.layers.dcn',
sources=[
'src/deform_pool_cuda.cpp',
'src/deform_pool_cuda_kernel.cu'
]),
]
ext_modules = [
make_cython_ext(
name='soft_nms_cpu',
module='detector.nms',
sources=['src/soft_nms_cpu.pyx']),
make_cuda_ext(
name='nms_cpu',
module='detector.nms',
sources=['src/nms_cpu.cpp']),
make_cuda_ext(
name='nms_cuda',
module='detector.nms',
sources=['src/nms_cuda.cpp', 'src/nms_kernel.cu']),
make_cuda_ext(
name='roi_align_cuda',
module='alphapose.utils.roi_align',
sources=['src/roi_align_cuda.cpp', 'src/roi_align_kernel.cu']),
make_cuda_ext(
name='deform_conv_cuda',
module='alphapose.models.layers.dcn',
sources=[
'src/deform_conv_cuda.cpp',
'src/deform_conv_cuda_kernel.cu'
]),
make_cuda_ext(
name='deform_pool_cuda',
module='alphapose.models.layers.dcn',
sources=[
'src/deform_pool_cuda.cpp',
'src/deform_pool_cuda_kernel.cu'
]),
]
return ext_modules


Expand Down