damo-cv / mogface Goto Github PK
View Code? Open in Web Editor NEWAn official code for MogFace
An official code for MogFace
I tried to run in a CPU only machine and run into issues. Is it possible? Which adjustments in the code are necessary?
I am trying to train the mogface with configurations from MogFace.yml to reproduce the best sota results on wider face but I am getting this error:
MogFace-master/train.py", line 138, in
images, targets = next(batch_iterator)
ValueError: too many values to unpack (expected 2)
Does anybody know how to overcome this error ?
Hello,
I would like to ask a few questions about this github repo.
问题:
1. 论文与工程实现不一致。
I am trying to perform a fine-tune and would like to be able to control the proportion between negative and positive anchors that are passed to the prednet.
I see that Pytorch implementation for Faster R-CNN have a hyper param for that:
https://github.com/pytorch/vision/blob/main/torchvision/models/detection/faster_rcnn.py#L116
I would expect it to be here in Mogface:
https://github.com/damo-cv/MogFace/blob/master/modelling/architectures/widerface_basenet.py#L74
But I found this "if else" statement with same code for both logic branches, so I assume it was removed.
Is it true, it was removed? Or is it elsewhere?
Thanks in advance for anyone that can help me
问题:
1. 论文与工程实现不一致,论文明显有随意编造的部分,与工程差异非常大。
2. 工程实现结果与论文不一致,差异很大
3.简单的问题为什么在论文中复杂化,虚构化?
Thank you for sharing this project. I always encounter similar mistakes, can you help me to see the reason?
【cpu environment,python 3.6.7,torch 1.10.2】
Load model from ./model_70000.pth
Finish load model.
img-id1-object-1.png
width: 327, height: 314
C:/Users//Downloads/MogFace-master/aa.py:53: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
x = Variable(x, volatile=True)
C:\my_dir*\venv\lib\site-packages\torch\nn\functional.py:3509: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
C:\my_dir*\venv\lib\site-packages\torch\nn\functional.py:3635: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode)
C:\my_dir*\venv\lib\site-packages\torch\nn\functional.py:1806: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
pyramid_feature_list: 6
Traceback (most recent call last):
File "C:/Users//Downloads/MogFace-master/aa.py", line 237, in
boxes = process_img(img, net, generate_anchors_fn, normalize_setting)
File "C:/Users//Downloads/MogFace-master/aa.py", line 152, in process_img
boxes = detect_face(net, img, shrink, generate_anchors_fn) # origin test
File "C:/Users//Downloads/MogFace-master/aa.py", line 55, in detect_face
out = net(x)
File "C:\my_dir*\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users*\Downloads\MogFace-master\modelling\architectures\widerface_basenet.py", line 83, in forward
conf, loc, mask_fp_context_fts = self.pred_net(pyramid_feature_list)
File "C:\my_dir*\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users*\Downloads\MogFace-master\modelling\pred_modules\pred_net.py", line 267, in forward
mask_fp_context_ft[tmp_shift] = 1
IndexError: index 5 is out of bounds for dimension 2 with size 5
Process finished with exit code 1
【gpu environment,python 3.7.13,torch 1.10.0+cu111】
Load model from ./model_70000.pth
Finish load model.
face_wujian.jpg
width: 500, height: 500
/root/code//MogFace-master/aa.py:54: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
x = Variable(x.cuda(), volatile=True)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:3509: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:3635: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:1806: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
Inference time : 865
The image with bbox is saved as ./tmp_img/0.13437671850930222.jpg
face_age.png
width: 1160, height: 304
Inference time : 655
The image with bbox is saved as ./tmp_img/0.6703785369022076.jpg
img_00106.png
width: 540, height: 640
Inference time : 487
The image with bbox is saved as ./tmp_img/0.9521100804886025.jpg
single_face.jpeg
width: 700, height: 720
/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:93: operator(): block: [0,0,0], thread: [6,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds"
failed.
/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:93: operator(): block: [0,0,0], thread: [10,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds"
failed.
Traceback (most recent call last):
File "/root/code//MogFace-master/aa.py", line 234, in
boxes = process_img(img, net, generate_anchors_fn, normalize_setting)
File "/root/code//MogFace-master/aa.py", line 153, in process_img
boxes = detect_face(net, img, shrink, generate_anchors_fn) # origin test
File "/root/code//MogFace-master/aa.py", line 56, in detect_face
out = net(x)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, **kwargs)
File "/root/code//MogFace-master/modelling/architectures/widerface_basenet.py", line 75, in forward
conf, loc, mask_fp_context_fts = self.pred_net(pyramid_feature_list)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, **kwargs)
File "/root/code//MogFace-master/modelling/pred_modules/pred_net.py", line 266, in forward
mask_fp_context_ft[tmp_shift] = 1
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Process finished with exit code 1
There is no test/detect_face function for detecting faces in images other than the widerface dataset.
In the USAGE it may be “MogFace_E” but not “MogFace-E”
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.