Giter Site home page Giter Site logo

yangli18 / hand_detection Goto Github PK

View Code? Open in Web Editor NEW
152.0 4.0 32.0 42.55 MB

A Light CNN based Method for Hand Detection and Orientation Estimation

License: MIT License

Python 93.54% Shell 0.56% Cuda 2.10% C 3.80%
hand-detection orientation-estimation single-shot-multibox-detector mobilenet mobilenet-ssd object-detection ssd pytorch oxford-hand-dataset

hand_detection's People

Contributors

yangli18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hand_detection's Issues

How can I print hand orientation in an image

@yangli18 I have completed training and evaluation. I want test my own image. You have not included the code to print test image result with hand orientation vectors. Please provide code to print hand orientation with test image

test my own picture

Thank you for providing the code,But I encountered difficulties when testing.How can I test my own picture and output the result of the picture?

Issue with torch.utils.ffi

So, now i'm on Ubuntu 16.04 everything appears to be fine until build.py i got this error :

Traceback (most recent call last):
File "build.py", line 3, in
from torch.utils.ffi import create_extension
File "/home/the-taco-coder/.local/lib/python3.5/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

Any help would be really appreciated.

Thanks iin advance for the awesome work

Orientation Estimation

@yangli18 What a great work. I just saw your work few days ago, read your paper but when looking into your codes, I cant see where Projection loss and Wrist loss are ?

'module name can\'t contain "."'

what is version with pytorch to run demo?i have installde 1.2.but when i run dem,bui it is wrong.

error in mobilenet_v1_base "end_point_base"

KeyError: 'module name can\'t contain "."'

Hello, I have problem during running the python3 eval.py --trained_model weights/ssd_new_mobilenet_FFA.pth --version ssd_new_mobilenet_FFA
The error message is KeyError: 'module name can\'t contain "."'
How to fix it?

module name can't contain \".\"

Hi

I wanted to try your code but due to updates in python the modules cannot contain "." in their keys so it cannot be used to load your pretrained weights to train. Is there a way you can change their keys? e.g. features.Conv2d_6.pointwise.0.weight to features_Conv2d_6.pointwise.0.weight

Got import error when running evaluation

python eval.py --trained_model weights/ssd_new_mobilenet_FFA.pth --version ssd_new_mobilenet_FFA --cuda False

got error:

ImportError: /home/vr/handOrientation/hand_detection/layers/_ext/nms/_nms.so: undefined symbol: __cudaRegisterFatBinaryEnd

ImportError: ../layers/_ext/nms/_nms.so: undefined symbol: __gxx_personality_v0

Hello, Thanks for your detailed instructions.

Pleas help me to resolve the below error.

I compiled the NMS code as you given sh layers/src/make.sh and I mentioned the trace logs of this compilation as below:

Compiling nms kernels by nvcc...
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers
generating /tmp/tmp0wro7mgm/_nms.c
setting the current directory to '/tmp/tmp0wro7mgm'
running build_ext
building '_nms' extension
creating home
creating home/vasanthahr
creating home/vasanthahr/code
creating home/vasanthahr/code/python
creating home/vasanthahr/code/python/proj
creating home/vasanthahr/code/python/proj/live_video_process
creating home/vasanthahr/code/python/proj/live_video_process/pytorch
creating home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient
creating home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master
creating home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers
creating home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/include/python3.5m -c _nms.c -o ./_nms.o
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include -I/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/include/python3.5m -c /home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.c -o ./home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.o
In file included from /home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:4:0,
                 from /home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.c:1:
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.c: In function ‘cpu_nms’:
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.c:7:42: warning: passing argument 1 of ‘THLongTensor_isContiguous’ from incompatible pointer type [-Wincompatible-pointer-types]
     THArgCheck(THLongTensor_isContiguous(boxes), 2, "boxes must be contiguous");
                                          ^
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THGeneral.h:80:35: note: in definition of macro ‘THArgCheck’
   _THArgCheck(__FILE__, __LINE__, __VA_ARGS__);                       \
                                   ^~~~~~~~~~~
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:8:39: note: expected ‘const THLongTensor * {aka const struct THLongTensor *}’ but argument is of type ‘THFloatTensor * {aka struct THFloatTensor *}’
 #define THTensor_(NAME)   TH_CONCAT_4(TH,Real,Tensor_,NAME)
                                       ^
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THGeneral.h:118:37: note: in definition of macro ‘TH_CONCAT_4_EXPAND’
 #define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
                                     ^
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:8:27: note: in expansion of macro ‘TH_CONCAT_4’
 #define THTensor_(NAME)   TH_CONCAT_4(TH,Real,Tensor_,NAME)
                           ^~~~~~~~~~~
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:115:12: note: in expansion of macro ‘THTensor_’
 TH_API int THTensor_(isContiguous)(const THTensor *self);
            ^~~~~~~~~
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.c:9:42: warning: passing argument 1 of ‘THLongTensor_isContiguous’ from incompatible pointer type [-Wincompatible-pointer-types]
     THArgCheck(THLongTensor_isContiguous(areas), 4, "areas must be contiguous");
                                          ^
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THGeneral.h:80:35: note: in definition of macro ‘THArgCheck’
   _THArgCheck(__FILE__, __LINE__, __VA_ARGS__);                       \
                                   ^~~~~~~~~~~
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:8:39: note: expected ‘const THLongTensor * {aka const struct THLongTensor *}’ but argument is of type ‘THFloatTensor * {aka struct THFloatTensor *}’
 #define THTensor_(NAME)   TH_CONCAT_4(TH,Real,Tensor_,NAME)
                                       ^
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THGeneral.h:118:37: note: in definition of macro ‘TH_CONCAT_4_EXPAND’
 #define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
                                     ^
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/THTensor.h:8:27: note: in expansion of macro ‘TH_CONCAT_4’
 #define THTensor_(NAME)   TH_CONCAT_4(TH,Real,Tensor_,NAME)
                           ^~~~~~~~~~~
/home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/env_pytorch_hand_det/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/TH/generic/THTensor.h:115:12: note: in expansion of macro ‘THTensor_’
 TH_API int THTensor_(isContiguous)(const THTensor *self);
            ^~~~~~~~~
gcc -pthread -shared ./_nms.o ./home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/nms.o /home/vasanthahr/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/src/cuda/nms_kernel.cu.o -o ./_nms.so

After compiling above NMS, i tried to execute the demo.ipynb file, but I was getting below error:

ImportError                               Traceback (most recent call last)
<ipython-input-1-53ca6c231f5b> in <module>
     14 sys.path.append('../')
     15 # from data import VOC_CLASSES
---> 16 from models.ssd_new_mobilenet_FFA import build_ssd

~/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/models/ssd_new_mobilenet_FFA.py in <module>
      3 import torch.nn.functional as F
      4 from torch.autograd import Variable
----> 5 from layers import *
      6 from data import v2
      7 import os

~/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/__init__.py in <module>
----> 1 from .functions import *
      2 from .modules import *

~/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/functions/__init__.py in <module>
----> 1 from .detection import Detect
      2 from .prior_box import PriorBox
      3 
      4 
      5 __all__ = ['Detect', 'PriorBox']

~/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/functions/detection.py in <module>
      4 from torch.autograd import Function
      5 from torch.autograd import Variable
----> 6 from ..box_utils import decode_v2, nms_new, nms_new_gpu, nms_old
      7 from data import v2 as cfg
      8 

~/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/box_utils.py in <module>
    283 
    284 
--> 285 from ._ext import nms
    286 
    287 def nms_new(boxes, scores, overlap=0.5, top_k=200):

~/code/python/proj/live_video_process/pytorch/hand_det_orient/hand_detection-master/layers/_ext/nms/__init__.py in <module>
      1 
      2 from torch.utils.ffi import _wrap_function
----> 3 from ._nms import lib as _lib, ffi as _ffi
      4 
      5 __all__ = []

ImportError: ../layers/_ext/nms/_nms.so: undefined symbol: __gxx_personality_v0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.