diff --git a/alphapose/utils/vis.py b/alphapose/utils/vis.py index 8eacbba5..fa78db90 100644 --- a/alphapose/utils/vis.py +++ b/alphapose/utils/vis.py @@ -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: @@ -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: @@ -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 diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 7fe74ed3..14c7061d 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -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. @@ -99,4 +102,4 @@ Download and extract them under `./data`, and make them look like this: |-- 036645665.jpg |-- 045572740.jpg |-- ... -``` \ No newline at end of file +``` diff --git a/setup.py b/setup.py index 09edf805..d0980945 100644 --- a/setup.py +++ b/setup.py @@ -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