Giter VIP home page Giter VIP logo

face_pytorch's People

Contributors

wujiyang 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

face_pytorch's Issues

关于train的精度

您好~运行了您的代码之后,训练集 训练了几个epoch之后,acc一直是0,数据和类别(webface)应该没有问题,您的代码我删去了最后一个bn(有这个bn会报错),请问这正常吗? 如果不正常可能是什么原因造成的呢?非常感谢

Question about training epochs

Hi~

Are the results reproducible from the default settings (e.g., total epochs = 11) in train.py?
Are there different hyper-parameters for different CNN under different scenarios?
(e.g., ResNet vs. MobileFaceNet, Small dataset vs. Large dataset?)

Thank you.

Help!

Could you tell me the detail about how to made the webface_align_train.list? I did not have this label of the casia-webface dataset.

About megaface performance

The test results of your recreated megaface are very different from those in Arcface paper. Do you know the problem there?

How evaluate the performance on MegaFace?

Hi~

Thank you for your great work!

The megaface devkit requires 2 files (i.e., megaface and facescrub) for performance evaluation.
However, the eval_megaface.py generates .feat in each folder. (do we wrongly used the script?)
How do we evaluate the performance on megaface?

Thank you.

softmax doesn't work?

I use net&margin to realize classification for three types, and i choose the “softmax” margin. Unfortunately, the output seems illegal, eg.[7266.1162, -10416.0654, 1476.0536] which not in [0,1].
Thank you for your reading.
-park jimin

Line 52, margin/sphereMarginProduct

phi_theta_ = (self.cur_lambda * cos_theta + phi_theta) / (1 + self.cur_lambda)
What is the purpose of this line?
It looks like taking a weighted sum of cos and the margined loss.
Could you please hint me?

How long does it take to train ?

Hi, I choose the MS-celeb-1M as the training set .But it seems that the training speed is very slow .How long does it take to train usually ?

Question about ArcFaceNet

class BottleNeck_IR_SE(nn.Module):
def init(self, in_channel, out_channel, stride):
super(BottleNeck_IR_SE, self).init()
if in_channel == out_channel:
self.shortcut_layer = nn.MaxPool2d(1, stride)
else:
self.shortcut_layer = nn.Sequential(
nn.Conv2d(in_channel, out_channel, kernel_size=(1, 1), stride=stride, bias=False),
nn.BatchNorm2d(out_channel)
)
I wonder why you use nn.MaxPool2d(1, stride) when in_channel == out_channel? I didn't find it in the raw ResNet and ArcFaceNet. I think there should be none like you write in the cbam.py:

if dim_match: self.shortcut_layer = None
Wating for your response and thanks a lot!

您好,再请教一个arcfacenet的SEresnet的问题

class SEResNet_IR(nn.Module):
    def __init__(self, num_layers, feature_dim=512, drop_ratio=0.4, mode = 'ir'):
        super(SEResNet_IR, self).__init__()
        assert num_layers in [50, 100, 152], 'num_layers should be 50, 100 or 152'
        assert mode in ['ir', 'se_ir'], 'mode should be ir or se_ir'
        blocks = get_blocks(num_layers)
        if mode == 'ir':
            unit_module = BottleNeck_IR
        elif mode == 'se_ir':
            unit_module = BottleNeck_IR_SE
        self.input_layer = nn.Sequential(nn.Conv2d(3, 64, (3, 3), 1, 1, bias=False),
                                         nn.BatchNorm2d(64),
                                         nn.PReLU(64))

        self.output_layer = nn.Sequential(nn.BatchNorm2d(512),
                                          nn.Dropout(drop_ratio),
                                          Flatten(),
                                          nn.Linear(512 * 7 * 7, feature_dim),
                                          nn.BatchNorm1d(feature_dim))

您默认的是选择resnet100的,那如果我使用50以及152,需要修改 nn.Linear(512 * 7 * 7, feature_dim)吗?或者arcfacenet这个脚本需要修改吗?

我训练到4400次时出现了个问题 ValueError: Expected more than 1 value per channel when training, got input size [1, 512],百度之后是说我batchsize存在1个样本,可是我计算了没有出现1个样本,不知道怎么解决,如果您知道的话麻烦告诉我一下

How to reproduce the result in README?

I download the dataset produced in #5 ,and try to reproduce the result showed in README. However, the train accuracy stuck in 0. Can you give me some details about how modified the code?

您好,请问如何将CASIA webface对齐呢?

我使用facenet里面的align_dataset_mtcnn.py将CASIA对齐,可是它会使人脸变胖,怎么才能像您提供的lfw一样对齐的那么好,还有仿射变换呢?我找了好几天都没有找到方法。我的英文不太好,我看到您的id猜测您是**人,所以写中文了,请见谅

train.list的问题

您好,下载了您提供的数据集里面没有train.list文件,您可以提供吗?还是我们可以从哪里获取?刚刚做人脸还不太懂,如果问题太蠢还请多多包涵

How to do 1:1 face verification?

Hi,
Thanks for this compilation.
I'm trying to do one on one face verification specifically based on mobilefacenet. How to compare distance between two feature vectors generated by model. I found loss function for mobilefacenet is arcface. If that is the similarity measure, how to compute arcface loss between two feature vectors.
Please share your thoughts.
Regards!

what does the "mu" mean in the lfw_eval.py

mu = np.mean(np.concatenate((featureLs[valFold[0], :], featureRs[valFold[0], :]), 0), 0)
mu = np.expand_dims(mu, 0)
featureLs = featureLs - mu
featureRs = featureRs - mu

HI,thanks for your jobs?. Could i ask you a problem? What does the "mu" mean in the lfw_eval.py?

关于A-softmax的知识点问题

您好,我正在尝试复现A-softmax。这是您的代码中的相关操作,想问一下您这个cur_lambda和Iter的作用是什么?非常感谢
`
def forward(self, input, label):
self.iter += 1
self.cur_lambda = max(self.lambda_min, self.base * (1 + self.gamma * self.iter) ** (-1 * self.power))

    cos_theta = F.linear(F.normalize(input), F.normalize(self.weight))
    cos_theta = cos_theta(-1, 1)

    cos_m_theta = self.margin_formula(self.m)(cos_theta)
    theta = cos_theta.data.acos()
    k = ((self.m * theta) / math.pi).floor()
    phi_theta = ((-1.0) ** k) * cos_m_theta - 2 * k
    phi_theta_ = (self.cur_lambda * cos_theta + phi_theta) / (1 + self.cur_lambda)
    norm_of_feature = torch.norm(input, 2, 1)

    one_hot = torch.zeros_like(cos_theta)
    one_hot.scatter_(1, label.view(-1, 1), 1)

    output = one_hot * phi_theta_ + (1 - one_hot) * cos_theta
    output *= norm_of_feature.view(-1, 1)

    return output

`

Training epochs for MobileFaceNet

Hi~

We trained mobilefacenet with 60 epochs on CASIA (small protocol) but still cannot achieved the reported accuracy (before removing noise).
Initial LR=0.1, and divided by 10 at epoch 36, 52, 58 respectively.

We wonder the required training epochs for achieving the reported results.

Thank you.

关于数据集格式的问题

你好,我想麻烦问一下,--lfw_test_root', type=str, default='/media/sda/lfw/lfw_align_112',这个lfw_align_112里放的数据集是.bin格式的文件,还是包含.jpg图片的一个个文件夹。

使用您的代码,我在lfw的得分可以达到99.6,但是实际应用场景会出现大批量的认错

您好:
使用您的代码我在lfw的得分可以达到99.6,但是实际应用场景会出现大批量的认错。为了不认错把阀值调高,又会出现认不出的情况。我初步分析是两个原因,一个是实际使用中有复杂的光照,还一个是训练数据集中大部分是欧美人脸,亚洲人脸很少。用欧美人脸训练出来的模型对亚洲人脸识别不好。请问您感觉还会有什么原因造成这种情况

How to undersatand the weight?

You have done a great work!

But I have a question about the ArcFace_loss. How to understand the weigth as show bellow:

image

I think thay are stand for the parameters of the last fully connected layer. But I wonder how to upodate them. In your code, I think they are fixed values, are they?

Looking forward to your reply.

What does the 600 means?

Hi,thank you for sharing this excellent repertory !
But when I want to eval my model, I have a question, what does the number 600 means in the ./dataset/lfw.py Line 47 ?
It has confuse me, could you tell me what does this number mean? Thanks.

Unable to achieve the effect on your ReadME page(SE-ResNet50-IR,Webface )

I used the default parameters and train SE-ResNet50-IR on CASIA-WebFace dataset, but can't get the result on your ReadME page.
Finally Accuracy:
20200315-05:22:09 Finally Best Accuracy: LFW: 99.4000 in iters: 42000, AgeDB-30: 93.8333 in iters: 27000 and CFP-FP: 94.6714 in iters: 24000
So what are the skills in the training? Can you share the parameters of the results on the readme page?
Thank you.

我使用了默认的参数,在CASIA-WebFace数据集上训练。backbone是SE-ResNet50-IR。无法达到ReadME和论文的效果。能否分享下参数或者训练技巧呢?谢谢。

arcface backbone to tensorrt

Thank for your work!
I want to convert arcface to tensorrt, but nn.BatchNorm1d(feature_dim)) do not support 2D in tensorrt. the error message is " what(): No converter registered for op type: Squeeze " .
In torch/onnx/symbolic.py, 2D tensor will be unsqueeze to 3D first and then squeeze to 2D after BatchNorm.

look forward to your replay! thank you!

train accuracy

Thank you for shareing your code.
I train the Mobilefacenet model,but only get 63% accuracy on LFW and 58% on AgeDB.
Can you give me some advice? I can not find reasons.

Visdom successfully connected to server '>' not supported between instances of 'float' and 'NoneType' Traceback (most recent call last): File "e:/AI-pro/Insightface/Face_Pytorch-master/train_my.py", line 263, in <module> train(args) File "e:/AI-pro/Insightface/Face_Pytorch-master/train_my.py", line 155, in train total_loss.backward() File "C:\Users\Administrator\Anaconda3\lib\site-packages\torch\tensor.py", line 107, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "C:\Users\Administrator\Anaconda3\lib\site-packages\torch\autograd\__init__.py", line 93, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: cuda runtime error (59) : device-side assert triggered at C:/w/1/s/windows/pytorch/aten/src\THC/generic/THCTensorMath.cu:26

When I ran train.py, I got the error. Who knows why and how to solve it?

parameter:scale size

What does the parameter(scale_size) mean? Could I need to change it according to my dataset?

RuntimeError: size mismatch

I got an error: RuntimeError: size mismatch, m1: [1 x 32768], m2: [25088 x 512] at /opt/conda/conda-bld/pytorch_1549628766161/work/aten/src/THC/generic/THCTensorMathBlas.cu:266.
My backbone is Res50_IR. I dont know how to fix this. What should i do ?

关于训练时accuracy一直为0的问题

您好!我在用您的代码跑的时候,训练时的accuracy信息一直显示为0,而loss则有下降,请问是什么原因呢?我的pytorch版本是0.4.0,是因为版本的原因吗?

About the soft margin in the ArcLoss

2019-11-18 17-46-58 的屏幕截图

I can not understand the easy_margin, why the cosine >0, we choose the phi, otherwise the cosine.
the phi is smaller than the consine, and the CE loss don"t contain any absolute value, so why should we pick a absolute value smaller one

Questions about the performance of megaface with @R notation

Hi~

Is the symbol @r represent the cleaned megaface dataset as stated in insighface paper?
The performance is improved significantly with symbol R in your experiments.

We tried the cleaned script, but it only cleaned 24 files which the improvement is little.
We would like to know the effect of the cleaned megaface if symbol R represents the noise removal.

Thank you.

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.