Giter Club home page Giter Club logo

mtcnn-pytorch's People

Contributors

coscubes avatar minhng92 avatar tropcomplique 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtcnn-pytorch's Issues

how to run the this code using gpu

I found that it is a bit slow when I run this code. Then I check the usage of gpu and I found this code was run on the cpu. So I want to change the code to run on the gpu. But I found the type of weight of this model is torch.FloatTensor. Is that mean I cannot use the gpu to run this code directly? Is that any solution can help me to run this code on gpu?

Here is the error:
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'weight'

Preprocess Image

Hello, thank you so much for your great works.

  1. Why do we need use this line img = (img - 127.5)*0.0078125 in preprocess image?
  2. I have try to convert it in opencv, but seems like the number of bounding box in the final is same, but in the process is much reduced. Do you think this is because of BGR to RGB conversion?, since opencv is BGR so I convert it first to RGB.
  3. Why you not using pnet. eval() and rnet.eval() ?

AttributeError: 'PNet' object has no attribute 'named_parameters'

Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from src import detect_faces
>>> from PIL import Image
>>> image = Image.open('images/example.png')
>>> bounding_boxes, landmarks = detect_faces(images)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'images' is not defined
>>> bounding_boxes, landmarks = detect_faces(image)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/mtcnn/src/detector.py", line 25, in detect_faces
    pnet = PNet()
  File "/home/ubuntu/mtcnn/src/get_nets.py", line 56, in __init__
    for n, p in self.named_parameters():
  File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 235, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'PNet' object has no attribute 'named_parameters'

I can see at get_nets.py line #56 the offending code, and I can see that PyTorch supports that function, so it seems a bit bizarre to me.
I have PyTorch 0.1.10 on a Jetson TX2.

Can use pytorch directly train the mtcnn?

first thanks for your sharing code, it is good for me to use pytorch get the model test, I want to know can this model be trained directly using pytorch, instead converting the caffe model to npy.

Why need to switch dim2 a dim3 when convert Caffe weights to PyTorch?

Hi TropComplique,

First, very appreciate for your great work, learned much from your source code.

I have one question, why we need to switch dim2 a dim3 when convert Caffe weights to PyTorch like below:

extract_weights_from_caffe_models.py
all_weights[name + '.weight'] = net.params[p][0].data.transpose((0, 1, 3, 2))

Does the shape of Caffe weight is [N, C, W, H]? So we need to change it to [N, C, H, W], right?

Hope for your reply.

How can I get your OpenVino version .ipynb?

I'm interested in OpenVino lately. And I found the question you asked at here. I would like to try your OpenVino version notebook and learn how to play with a openvino mtcnn model. Unfortunately, the link of notebook have been invalid. So I wish that you can give me some help. May I get your openvino version notebook along with the models that you successfully transferred?
Thx a lot :)

Upload to PyPI

Hi! I just upload this project to PyPI repository for easy installation and made some minor changes. If this is ok for you.

Here is my repos with changes:
https://github.com/khrlimam/mtcnn-pytorch

A few change I made:

  1. Delete all the files that unnecessary for the package it self.
  2. Rename the package directory.
  3. Upload the weights to Github release.
  4. Load the weights online.

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.