tropcomplique / mtcnn-pytorch Goto Github PK
View Code? Open in Web Editor NEWJoint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
License: MIT License
Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
License: MIT License
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'
Hello, thank you so much for your great works.
img = (img - 127.5)*0.0078125
in preprocess image?pnet. eval()
and rnet.eval()
?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.
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.
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.
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 :)
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:
Hi, from the paper I infer that this method was trained for different datasets. Could you tell me which dataset your model was trained on?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.