Giter VIP home page Giter VIP logo

mxnet-face's Introduction

Using MXNet for Face-related Algorithm


About

Using mxnet for face-related algorithm, here now only provide :

  • a trained mxnet-face-fr50(faster-rcnn+resnet-50) model, which achieve tpr=90.4% when fp=100 and tpr=95.5% when fp=500 on fddb.
  • a trained lightened cnn[1] model on Face Identity, together with the training script, the single model get 97.13%+-0.88% accuracy on LFW, and with only 20MB size.
  • a trained lightened moon[1][2] model (combine the changed lightened cnn and moon loss) on Face Attribute Prediction, together with the training script, the single model get about 87.41% accuracy on CelebA, and with only 18MB size.

Before runing

cd model
./get-models.sh
  • this will download the face alignned model used in dlib, because in the face identification experiment, it will use face alignment technology before extractting face faceture.
  • using my slightly changed mxnet branch face if you want to train/test the face attribution model.

Face Detection

we provide the pre-trained model mxnet-face-fr50-0000.params on baiduyun or dropbox, which is trained with resnet-50+faser-rcnn for 7 epoch on wider-face[4] dataset, our mxnet-face-fr50's performance on fddb is:
mxnet-face-fr50-roc.png

you can also find the result on fddb official website
the training code is come from my anohter repo : train_widerface.py

the way of using mxnet-face-fr50 for face detection is very easy:

  • download mxnet-face-fr50-0000.params,mxnet-face-fr50-symbol.jsonand put them into detection directory.
  • got to detection dir, and run ./demo.sh, you can set different parameters for face detection, see it by python detection.py --help

BTW, the detection speed is slow, only about 3~4 image/second on k80 GPU.

Face Identification

How to test

run ./test.sh in shell.
This script will run the evaluation on lfw using trained model, the model needs 128x128 image size for input, you can using your own aligned lfw data, we also offered the aligin-lfw dataset, passward : mg2i.
before runing, you should change your own align_data_path in test.sh. the model

How to train

run ./run.sh in shell.
This script will train the lightened cnn face model, using CASIA-WebFace dataset, more accurately, i used the cleaned version.
Again, you should change with your own setting in run.sh, and using your own hyper-parameter when training the model.

Implemented details
  • you should installed the dlib and opencv libirary with python interface firstly.
  • using dlib for face detection and alignment like openface, but you can also choose opencv for detection, i have provided the detection model in model/opencv/cascade.xml.
  • 385504 images for train, and 20290 for val.
  • run ./model/get-models.sh to download the shape_predictor_68_face_landmarks.dat for face alignment.
How to improve accuracy on LFW?
  • using more accurate aligned face images for trainig, currently the aligned face images for training has many mistake images, which will hurt the perfomance. you can using more powerful face detection and alignment for face processing.
  • using more data
  • add verification information
  • ...

Face Attribute Prediction

How to prediction

cd attribut
then put the image you want to predict with name aaa.jpg and run in shell:
python -u predict.py --img aaa.jpg the example output will like this:
example_out.png


How to test

run ./test.sh in shell. this script will run the evaluation on CelebA dataset, the dataset is used for face attribute prediction, and each face image will have 40 binary attributes(labels), so we should using our model to predict the attribute of the test images in CelebA.

How to train

run ./run.sh in shell.
This script will train the lightened moon face model, using CelebA train and val dataset, we use the original image set, not the aligned set. so we should first using opencv and dlib to do face detection, enlarge the face area and then cropped it, we finally training the model using the cropped image.

Implemented details
  • 159923 training face, less than original training number, which is 162770, this is because the cropping phase failed when using face detection.
  • 19962 tesing face, less then original testing number,which is 19667 for the same reason
  • the lightened moon model is combine changed lightened cnn[1] and moon loss[2], please refer to the symbol file in attribute/lightened_moon.py
How to improve accuracy on CelebA?
  • using more accurate face deteciton or face alignment.
  • using more data
  • using more meaningful loss
  • ...

Reference

[1] Wu X, He R, Sun Z. A Lightened CNN for Deep Face Representation[J]. arXiv preprint arXiv:1511.02683, 2015.
[2] Rudd E, Günther M, Boult T. MOON: A Mixed Objective Optimization Network for the Recognition of Facial Attributes[J]. arXiv preprint arXiv:1603.07027, 2016.
[3] Jiang H, Learned-Miller E. Face detection with the faster R-CNN[J]. arXiv preprint arXiv:1606.03473, 2016. [4] Yang S, Luo P, Loy C C, et al. WIDER FACE: A Face Detection Benchmark[J]. arXiv preprint arXiv:1511.06523, 2015.

mxnet-face's People

Contributors

tornadomeet avatar vic-w 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mxnet-face's Issues

用DMLC的原始MXNET跑

用DMLC的原始MXNET跑你的模型能成功吗?不要求train,只要跑test,face identification 那个模型。

time cost for training?

I am using the CelebA as training set, which is same as your example. Could you tell me how long it takes to finish the training process?

gpu not enabled error

hi , I used your face identification model : lightened_cnn-0166.params lightened_cnn-symbol.json using mxnet's cpp example image-classification-predict.cc ,but got an error at 'MXPredCreate" ,it returned -1 and gives the following error:

[13:55:10] D:\chhong\mxnet\dmlc-core\include\dmlc/logging.h:235: [13:55:10]D:\chhong\mxnet\src\ndarray\ndarray.cc:283: GPU is not enabled

I did not forget to set int dev_type = 1;
I use the mxnet cpu-only binaries : 20160419_win10_x64_cpu_only.7z

IF i use the default model Inception_BN-symbol.json Inception_BN-0039.params ,everything is OK.

so whats the problem? How to run your model on cpu-only machines?

Using Moon_Output to train vgg-face but can't work at all

I want to implement the original Moon using the vgg-face net and your moon-loss function.But it didn't work and report no error just show training down.I do the following change based on your code.
(1)I choose to use the crop_aligned images from the CeleA database.
(2)When generate the .rec file, i use the resize=178 color=1 to resize and read RGB images.
(3)I chang the weight of your loss funtion all to 1.0 to following the original Moon.
(4)I choose vgg-face and just simply change the output layer to the new moon-output

I use the new moon-ouput to train your LCNN ,works well .But when i use the for my vgg-face net ,I show no error but just show train down 👍
[12:45:47] src/io/iter_image_recordio.cc:68: Loaded ImageList from /media/mt02/data1/dataset/CelebA/celeba_train.lst 162770 Image records
[12:45:47] src/io/iter_image_recordio.cc:211: ImageRecordIOParser: ./celeba_train.rec, use 3 threads for decoding..
[12:45:47] src/io/iter_image_recordio.cc:68: Loaded ImageList from /media/mt02/data1/dataset/CelebA/celeba_val.lst 19867 Image records
[12:45:47] src/io/iter_image_recordio.cc:211: ImageRecordIOParser: ./celeba_val.rec, use 3 threads for decoding..
INFO:root:Start training with [cpu(0)]
Start training with [cpu(0)]
trining done!

attached the training code i used

`def norm_stat(d):
return mx.nd.norm(d)/np.sqrt(d.size)
mon = mx.mon.Monitor(10, norm_stat)

def get_symbol(num_classes = 40):
## define alexnet
data = mx.symbol.Variable(name="data")
# group 1
conv1_1 = mx.symbol.Convolution(data=data, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_1")
relu1_1 = mx.symbol.Activation(data=conv1_1, act_type="relu", name="relu1_1")
conv1_2 = mx.symbol.Convolution(data=relu1_1, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_2")
relu1_2 = mx.symbol.Activation(data=conv1_2, act_type="relu", name="relu1_2")
pool1 = mx.symbol.Pooling(data=relu1_2, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool1")
# group 2
conv2_1 = mx.symbol.Convolution(data=pool1, kernel=(3, 3), pad=(1, 1), num_filter=128, name="conv2_1")
relu2_1 = mx.symbol.Activation(data=conv2_1, act_type="relu", name="relu2_1")
conv2_2 = mx.symbol.Convolution(data=pool1, kernel=(3, 3), pad=(1, 1), num_filter=128, name="conv2_2")
relu2_2 = mx.symbol.Activation(data=conv2_1, act_type="relu", name="relu2_2")
pool2 = mx.symbol.Pooling(data=relu2_1, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool2")
# group 3
conv3_1 = mx.symbol.Convolution(data=pool2, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_1")
relu3_1 = mx.symbol.Activation(data=conv3_1, act_type="relu", name="relu3_1")
conv3_2 = mx.symbol.Convolution(data=relu3_1, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_2")
relu3_2 = mx.symbol.Activation(data=conv3_2, act_type="relu", name="relu3_2")
conv3_3 = mx.symbol.Convolution(data=relu3_2, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_3")
relu3_3 = mx.symbol.Activation(data=conv3_3, act_type="relu", name="relu3_3")
pool3 = mx.symbol.Pooling(data=relu3_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool3")
# group 4
conv4_1 = mx.symbol.Convolution(data=pool3, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_1")
relu4_1 = mx.symbol.Activation(data=conv4_1, act_type="relu", name="relu4_1")
conv4_2 = mx.symbol.Convolution(data=relu4_1, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_2")
relu4_2 = mx.symbol.Activation(data=conv4_2, act_type="relu", name="relu4_2")
conv4_3 = mx.symbol.Convolution(data=relu4_2, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_3")
relu4_3 = mx.symbol.Activation(data=conv4_3, act_type="relu", name="relu4_3")
pool4 = mx.symbol.Pooling(data=relu4_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool4")
# group 5
conv5_1 = mx.symbol.Convolution(data=pool4, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_1")
relu5_1 = mx.symbol.Activation(data=conv5_1, act_type="relu", name="relu5_1")
conv5_2 = mx.symbol.Convolution(data=relu5_1, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_2")
relu5_2 = mx.symbol.Activation(data=conv5_2, act_type="relu", name="relu5_2")
conv5_3 = mx.symbol.Convolution(data=relu5_2, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_3")
relu5_3 = mx.symbol.Activation(data=conv5_3, act_type="relu", name="relu5_3")
pool5 = mx.symbol.Pooling(data=relu5_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool5")
# group 6
f1c6 = mx.symbol.FullyConnected(data=pool5, num_hidden=4096, name="f1c6",attr={'lr_mult':'0.1'})
relu6 = mx.symbol.Activation(data=f1c6, act_type="relu", name="relu6")
drop6 = mx.symbol.Dropout(data=relu6, p=0.5, name="drop6")
# group 7
f1c7 = mx.symbol.FullyConnected(data=drop6, num_hidden=4096, name="f1c7",attr={'lr_mult':'0.1'})
relu7 = mx.symbol.Activation(data=f1c7, act_type="relu", name="relu7")
drop7 = mx.symbol.Dropout(data=relu7, p=0.5, name="drop7")
# output
f1c8 = mx.symbol.FullyConnected(data=drop7, num_hidden=num_classes, name="f1c8",attr={'lr_mult':'0.1'})
moon = mx.symbol.MoonOutput(data=f1c8, src_dist_path='./src_dict.txt', name='Moon')
return moon

def main():

logging

if 'log_file' in args and args.log_file is not None:
    log_file = args.log_file
    log_dir = args.log_dir
    log_file_full_name = os.path.join(log_dir, log_file)
    if not os.path.exists(log_dir):
        os.mkdir(log_dir)
    logger = logging.getLogger()
    handler = logging.FileHandler(log_file_full_name)
    logger.addHandler(handler)
    handler = logging.StreamHandler()
    logger.addHandler(handler)
    logger.setLevel(logging.DEBUG)
    logger.info('start with arguments %s', args)
else:
    logging.basicConfig(level=logging.DEBUG, format=head)
    logging.info('start with arguments %s', args)
# symbol = lightened_moon(num_classes=40, use_fuse=False)
symbol = get_symbol(num_classes=40)
devs = mx.cpu() if args.gpus is None else [mx.gpu(int(i)) for i in args.gpus.split(',')]
epoch_size = args.num_examples / args.batch_size
checkpoint = mx.callback.do_checkpoint(args.model_save_prefix)
kv = mx.kvstore.create(args.kv_store)
arg_params = None
aux_params = None
if args.retrain:
    _, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)
train = mx.io.ImageRecordIter(
    path_imglist = args.list_dir + 'celeba_train.lst',
    path_imgrec = args.data_dir + "celeba_train.rec",
    label_width = 40,
    data_name   = 'data',
    label_name  = 'Moon_label',
    data_shape  = (3, 178, 178),
    scale       = 1./255,
    batch_size  = args.batch_size,
    rand_crop   = True,
    rand_mirror = True,
    num_parts   = kv.num_workers,
    part_index  = kv.rank)
val = mx.io.ImageRecordIter(
    path_imglist = args.list_dir + 'celeba_val.lst',
    path_imgrec = args.data_dir + "celeba_val.rec",
    label_width = 40,
    data_name   = 'data',
    label_name  = 'Moon_label',
    batch_size  = args.batch_size,
    data_shape  = (3, 178, 178),
    scale       = 1./255,
    rand_crop   = False,
    rand_mirror = False,
    num_parts   = kv.num_workers,
    part_index  = kv.rank)
model = mx.model.FeedForward(
    ctx                = devs,
    symbol             = symbol,
    arg_params         = arg_params,
    aux_params         = aux_params,
    num_epoch          = 100,
    begin_epoch        = args.model_load_epoch,
    learning_rate      = args.lr,
    momentum           = 0.9,
    wd                 = 0.00001,
    lr_scheduler       = mx.lr_scheduler.FactorScheduler(step=4*max(int(epoch_size * 1), 1), factor=0.8, stop_factor_lr=1e-5),
    initializer        = mx.init.Xavier(factor_type="in", magnitude=2.34)
    )
model.fit(
    X                  = train,
    eval_data          = val,
    eval_metric        = ['multi_binary_acc'],
    kvstore            = kv,
    batch_end_callback = mx.callback.Speedometer(args.batch_size, 10),
    epoch_end_callback = checkpoint)
    # monitor            = mon)`

Unable to perform Attribute Detetction

The attribute prediction script is failing at the following lline( I have downloaded the model).

_, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)

Traceback (most recent call last):
File "predict.py", line 83, in
main()
File "predict.py", line 14, in main
_, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)
File "/home/mridul/anaconda3/lib/python3.5/site-packages/mxnet/model.py", line 372, in load_checkpoint
symbol = sym.load('%s-symbol.json' % prefix)
File "/home/mridul/anaconda3/lib/python3.5/site-packages/mxnet/symbol.py", line 1056, in load
check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle)))
File "/home/mridul/anaconda3/lib/python3.5/site-packages/mxnet/base.py", line 75, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: Failed loading Op Moon of type MoonOutput: [02:02:41] src/core/op.cc:55: Che

conduct prediction using pre-trained model on Android

I already get compiled JNI library, and try to conduct prediction on Android. But I come to an error:mxnet_predict-all.cc:30483: Check failed: (data.shape_[1]) == (src_dist_.size()) Moon: shape mismatch between input channel and number parmaters in src_dist.txt

time cost

Thanks for sharing the code for face recognition.
On my android phone I exact the feature of one 128x128 image takes about 700ms.
and I test it on my laptop (CPU Only)it take about 570ms much slower than your python code about 250ms on one face.
Do you have any idea why the speed is slower ,I compiled OpenBLAS for android with USE_OPENMP?

label name?

@tornadomeet I am using the CelebA to train the CNN model, which has 40 labels. But I am not sure how the define the label name when I load train dataset. I see you just use 'Moon_label' in the example, could you give me some suggestion?

Change Moonoutput to SoftmaxOutput

@tornadomeet I try to train my own model using SoftmaxOutput instead of MoonOutput. Can I still use the same network architecture and similar hyper parameters? Could you give me some tips on this? Since I tried several times, but he prediction is always NaN.

the model's acc not so good as the original

sorry to bother you again! I test your model on my own dataset,I got more than 97% acc using the original model LightenedCNN_B_deploy.prototxt LightenedCNN_B.caffemodel in CAFFE ,but only got 86% using your model in MXNET .

I extracted the feature of layer "_maximum9" and compare 2 faces using eculidean dist .here is part of my cpp code(feature extraction part):

include <stdio.h>

// Path for c_predict_api

include <mxnet/c_predict_api.h>

include <opencv2/core/core.hpp>

include <opencv2/contrib/contrib.hpp>

include <opencv2/highgui/highgui.hpp>

include

include

include

include

using namespace std;
using namespace cv;
// Read file to buffer
class BufferFile {
public:
std::string file_path_;
int length_;
char* buffer_;

explicit BufferFile(std::string file_path)
    :file_path_(file_path) {

    std::ifstream ifs(file_path.c_str(), std::ios::in | std::ios::binary);
    if (!ifs) {
        std::cerr << "Can't open the file. Please check " << file_path << ". \n";
        assert(false);
    }

    ifs.seekg(0, std::ios::end);
    length_ = ifs.tellg();
    ifs.seekg(0, std::ios::beg);
    std::cout << file_path.c_str() << " ... " << length_ << " bytes\n";

    buffer_ = new char[sizeof(char)* length_];
    ifs.read(buffer_, length_);
    ifs.close();
}

int GetLength() {
    return length_;
}
char* GetBuffer() {
    return buffer_;
}

~BufferFile() {
    delete[] buffer_;
    buffer_ = NULL;
}

};

void GetMeanFile(const std::string image_file, mx_float* image_data,
const int channels, const cv::Size resize_size) {
cv::Mat im_ori = cv::imread(image_file, 0);

if (im_ori.empty()) {
    std::cerr << "Can't open the image. Please check " << image_file << ". \n";
    assert(false);
}

cv::Mat im;

resize(im_ori, im, resize_size);

int size = im.rows * im.cols * channels;

mx_float* ptr_image_r = image_data;

for (int i = 0; i < im.rows; i++) {
    uchar* data = im.ptr<uchar>(i);

    for (int j = 0; j < im.cols; j++) {

        mx_float r = static_cast<mx_float>(*data++);
        *ptr_image_r++ = r / 255.0;

    }
}

}

void PrintOutputResult(const std::vector& data, const std::vectorstd::string& synset) {
if (data.size() != synset.size()) {
std::cerr << "Result data and synset size does not match!" << std::endl;
}

float best_accuracy = 0.0;
int best_idx = 0;

for (int i = 0; i < static_cast<int>(data.size()); i++) {
    printf("Accuracy[%d] = %.8f\n", i, data[i]);

    if (data[i] > best_accuracy) {
        best_accuracy = data[i];
        best_idx = i;
    }
}

printf("Best Result: [%s] id = %d, accuracy = %.8f\n",
    synset[best_idx].c_str(), best_idx, best_accuracy);

}

int main() {

Mat f1, GH, GV, GSUB;

std::string test_file;
test_file = std::string("C:/tools/deepLearning/ak.png");
f1 = imread("C:/1.jpg", 0);
// Models path for your model, you have to modify it
//BufferFile json_data("C:/data/model/Inception_BN-symbol.json");
//BufferFile param_data("C:/data/model/Inception_BN-0039.params");
BufferFile json_data("C:/tools/deepLearning/MXNET/mxnet-face/model/lightened_cnn/lightened_cnn-symbol.json");
BufferFile param_data("C:/tools/deepLearning/MXNET/mxnet-face/model/lightened_cnn/lightened_cnn-0166_cpu.params");

// Parameters
int dev_type = 1;  // 1: cpu, 2: gpu
int dev_id = 0;  // arbitrary.
mx_uint num_input_nodes = 1;  // 1 for feedforward
const char* input_key[1] = { "data" };
const char** input_keys = input_key;

// Image size and channels
int width = 128;
int height = 128;
int channels = 1;

const mx_uint input_shape_indptr[2] = { 0, 4 };
// ( trained_width, trained_height, channel, num)
const mx_uint input_shape_data[4] = { 1,
    static_cast<mx_uint>(channels),
    static_cast<mx_uint>(width),
    static_cast<mx_uint>(height) };
PredictorHandle out = 0;  // alias for void *
const char* output_key[1] = { "_maximum9" };
const char** output_keys = output_key;
//-- Create Predictor
MXPredCreatePartialOut((const char*)json_data.GetBuffer(),
    (const char*)param_data.GetBuffer(),
    static_cast<size_t>(param_data.GetLength()),
    dev_type,
    dev_id,
    num_input_nodes,
    input_keys,
    input_shape_indptr,
    input_shape_data,
    1,
    output_keys,
    &out);

//std::cout << "ret" << ret; 
//int cc;
//std::cin >> cc;

int image_size = width * height * channels;
std::vector<mx_float> image_data = std::vector<mx_float>(image_size);

//-- Read Mean Data
GetMeanFile(test_file, image_data.data(), channels, cv::Size(width, height));

//-- Set Input Image
MXPredSetInput(out, "data", image_data.data(), image_size);

//-- Do Predict Forward
MXPredForward(out);

mx_uint output_index = 0;

mx_uint *shape = 0;
mx_uint shape_len;

//-- Get Output Result
MXPredGetOutputShape(out, output_index, &shape, &shape_len);

size_t size = 1;
for (mx_uint i = 0; i < shape_len; ++i) size *= shape[i];

std::vector<float> data(size);

MXPredGetOutput(out, output_index, &(data[0]), size);

for (size_t i = 0; i < size; i++)
{
    cout << data[i] << "  ";
}

// Release Predictor
MXPredFree(out);

cout << "  size  " << size << endl;

imshow("1", f1);
waitKey(0);

return 0;

}

AttributeError: 'module' object has no attribute 'MoonOutput'

I have cloned the 'face' branch, but still get this error?

INFO:root:Namespace(batch_size=384, data_dir='./', gpus='0', kv_store='local', list_dir='/data/celeba_dababase/moon_mxnet/im2rec/', lr=0.05, model_load_epoch=0, model_load_prefix='../model/lightened_moon/lightened_moon', model_save_prefix='../model/lightened_moon/lightened_moon_fuse', num_examples=159923, retrain=False)
Traceback (most recent call last):
File "lightened_moon.py", line 147, in
main()
File "lightened_moon.py", line 74, in main
symbol = lightened_moon(num_classes=40, use_fuse=True)
File "lightened_moon.py", line 69, in lightened_moon
moon = mx.symbol.MoonOutput(data=fc2, src_dist_path='./src_dict.txt', name='Moon')
AttributeError: 'module' object has no attribute 'MoonOutput'

ImportError: cannot import name 'izip'

I am running python 3.6 and while trying to run main.py, I got this error
Traceback (most recent call last): File "mtcnn_detector.py", line 9, in <module> from itertools import izip ImportError: cannot import name 'izip'
When I tried, python2 mtcnn_detector.py,I got this
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version! RequestsDependencyWarning)

Using Moon_Output to train vgg-face but can't work at all

I want to implement the original Moon using the vgg-face net and your moon-loss function.But it didn't work and report no error just show training down.I do the following change based on your code.
(1)I choose to use the crop_aligned images from the CeleA database.
(2)When generate the .rec file, i use the resize=178 color=1 to resize and read RGB images.
(3)I chang the weight of your loss funtion all to 1.0 to following the original Moon.
(4)I choose vgg-face and just simply change the output layer to the new moon-output

I use the new moon-ouput to train your LCNN ,works well .But when i use the for my vgg-face net ,I show no error but just show train down 👍
[12:45:47] src/io/iter_image_recordio.cc:68: Loaded ImageList from /media/mt02/data1/dataset/CelebA/celeba_train.lst 162770 Image records
[12:45:47] src/io/iter_image_recordio.cc:211: ImageRecordIOParser: ./celeba_train.rec, use 3 threads for decoding..
[12:45:47] src/io/iter_image_recordio.cc:68: Loaded ImageList from /media/mt02/data1/dataset/CelebA/celeba_val.lst 19867 Image records
[12:45:47] src/io/iter_image_recordio.cc:211: ImageRecordIOParser: ./celeba_val.rec, use 3 threads for decoding..
INFO:root:Start training with [cpu(0)]
Start training with [cpu(0)]
trining done!

attached the training code i used

`def norm_stat(d):
return mx.nd.norm(d)/np.sqrt(d.size)
mon = mx.mon.Monitor(10, norm_stat)

def get_symbol(num_classes = 40):
## define alexnet
data = mx.symbol.Variable(name="data")
# group 1
conv1_1 = mx.symbol.Convolution(data=data, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_1")
relu1_1 = mx.symbol.Activation(data=conv1_1, act_type="relu", name="relu1_1")
conv1_2 = mx.symbol.Convolution(data=relu1_1, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_2")
relu1_2 = mx.symbol.Activation(data=conv1_2, act_type="relu", name="relu1_2")
pool1 = mx.symbol.Pooling(data=relu1_2, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool1")
# group 2
conv2_1 = mx.symbol.Convolution(data=pool1, kernel=(3, 3), pad=(1, 1), num_filter=128, name="conv2_1")
relu2_1 = mx.symbol.Activation(data=conv2_1, act_type="relu", name="relu2_1")
conv2_2 = mx.symbol.Convolution(data=pool1, kernel=(3, 3), pad=(1, 1), num_filter=128, name="conv2_2")
relu2_2 = mx.symbol.Activation(data=conv2_1, act_type="relu", name="relu2_2")
pool2 = mx.symbol.Pooling(data=relu2_1, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool2")
# group 3
conv3_1 = mx.symbol.Convolution(data=pool2, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_1")
relu3_1 = mx.symbol.Activation(data=conv3_1, act_type="relu", name="relu3_1")
conv3_2 = mx.symbol.Convolution(data=relu3_1, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_2")
relu3_2 = mx.symbol.Activation(data=conv3_2, act_type="relu", name="relu3_2")
conv3_3 = mx.symbol.Convolution(data=relu3_2, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_3")
relu3_3 = mx.symbol.Activation(data=conv3_3, act_type="relu", name="relu3_3")
pool3 = mx.symbol.Pooling(data=relu3_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool3")
# group 4
conv4_1 = mx.symbol.Convolution(data=pool3, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_1")
relu4_1 = mx.symbol.Activation(data=conv4_1, act_type="relu", name="relu4_1")
conv4_2 = mx.symbol.Convolution(data=relu4_1, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_2")
relu4_2 = mx.symbol.Activation(data=conv4_2, act_type="relu", name="relu4_2")
conv4_3 = mx.symbol.Convolution(data=relu4_2, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_3")
relu4_3 = mx.symbol.Activation(data=conv4_3, act_type="relu", name="relu4_3")
pool4 = mx.symbol.Pooling(data=relu4_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool4")
# group 5
conv5_1 = mx.symbol.Convolution(data=pool4, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_1")
relu5_1 = mx.symbol.Activation(data=conv5_1, act_type="relu", name="relu5_1")
conv5_2 = mx.symbol.Convolution(data=relu5_1, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_2")
relu5_2 = mx.symbol.Activation(data=conv5_2, act_type="relu", name="relu5_2")
conv5_3 = mx.symbol.Convolution(data=relu5_2, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_3")
relu5_3 = mx.symbol.Activation(data=conv5_3, act_type="relu", name="relu5_3")
pool5 = mx.symbol.Pooling(data=relu5_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool5")
# group 6
f1c6 = mx.symbol.FullyConnected(data=pool5, num_hidden=4096, name="f1c6",attr={'lr_mult':'0.1'})
relu6 = mx.symbol.Activation(data=f1c6, act_type="relu", name="relu6")
drop6 = mx.symbol.Dropout(data=relu6, p=0.5, name="drop6")
# group 7
f1c7 = mx.symbol.FullyConnected(data=drop6, num_hidden=4096, name="f1c7",attr={'lr_mult':'0.1'})
relu7 = mx.symbol.Activation(data=f1c7, act_type="relu", name="relu7")
drop7 = mx.symbol.Dropout(data=relu7, p=0.5, name="drop7")
# output
f1c8 = mx.symbol.FullyConnected(data=drop7, num_hidden=num_classes, name="f1c8",attr={'lr_mult':'0.1'})
moon = mx.symbol.MoonOutput(data=f1c8, src_dist_path='./src_dict.txt', name='Moon')
return moon

def main():

logging

if 'log_file' in args and args.log_file is not None:
    log_file = args.log_file
    log_dir = args.log_dir
    log_file_full_name = os.path.join(log_dir, log_file)
    if not os.path.exists(log_dir):
        os.mkdir(log_dir)
    logger = logging.getLogger()
    handler = logging.FileHandler(log_file_full_name)
    logger.addHandler(handler)
    handler = logging.StreamHandler()
    logger.addHandler(handler)
    logger.setLevel(logging.DEBUG)
    logger.info('start with arguments %s', args)
else:
    logging.basicConfig(level=logging.DEBUG, format=head)
    logging.info('start with arguments %s', args)
# symbol = lightened_moon(num_classes=40, use_fuse=False)
symbol = get_symbol(num_classes=40)
devs = mx.cpu() if args.gpus is None else [mx.gpu(int(i)) for i in args.gpus.split(',')]
epoch_size = args.num_examples / args.batch_size
checkpoint = mx.callback.do_checkpoint(args.model_save_prefix)
kv = mx.kvstore.create(args.kv_store)
arg_params = None
aux_params = None
if args.retrain:
    _, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)
train = mx.io.ImageRecordIter(
    path_imglist = args.list_dir + 'celeba_train.lst',
    path_imgrec = args.data_dir + "celeba_train.rec",
    label_width = 40,
    data_name   = 'data',
    label_name  = 'Moon_label',
    data_shape  = (3, 178, 178),
    scale       = 1./255,
    batch_size  = args.batch_size,
    rand_crop   = True,
    rand_mirror = True,
    num_parts   = kv.num_workers,
    part_index  = kv.rank)
val = mx.io.ImageRecordIter(
    path_imglist = args.list_dir + 'celeba_val.lst',
    path_imgrec = args.data_dir + "celeba_val.rec",
    label_width = 40,
    data_name   = 'data',
    label_name  = 'Moon_label',
    batch_size  = args.batch_size,
    data_shape  = (3, 178, 178),
    scale       = 1./255,
    rand_crop   = False,
    rand_mirror = False,
    num_parts   = kv.num_workers,
    part_index  = kv.rank)
model = mx.model.FeedForward(
    ctx                = devs,
    symbol             = symbol,
    arg_params         = arg_params,
    aux_params         = aux_params,
    num_epoch          = 100,
    begin_epoch        = args.model_load_epoch,
    learning_rate      = args.lr,
    momentum           = 0.9,
    wd                 = 0.00001,
    lr_scheduler       = mx.lr_scheduler.FactorScheduler(step=4*max(int(epoch_size * 1), 1), factor=0.8, stop_factor_lr=1e-5),
    initializer        = mx.init.Xavier(factor_type="in", magnitude=2.34)
    )
model.fit(
    X                  = train,
    eval_data          = val,
    eval_metric        = ['multi_binary_acc'],
    kvstore            = kv,
    batch_end_callback = mx.callback.Speedometer(args.batch_size, 10),
    epoch_end_callback = checkpoint)
    # monitor            = mon)`

face verification 10 times slower than in caffe with only cpu works?

Hello, i tested your face verification code on my laptop. However, when i tested on LFW,  i found that it costs about **750 ms per pair matching** if only cpu was used, approximately 10 times of 67 ms, tested in this essay, '_A Lightened CNN for Deep Face Representation_', which used caffe to test in the same situation(only cpu worked).  
PS. my laptop's cpu is i7-3632QM, while the essay uses i7-4790, i think that there should be some slight difference, but the difference shouldn't be so huge.
So here is the question, whether it is because mxnet  itself is slower than caffe in this situation? or any other reasons? 

error stop_factor_lr

Thx your share when I run this model and I found "lr_scheduler = mx.lr_scheduler.FactorScheduler(step=5*max(int(epoch_size * 1), 1), factor=0.8, stop_factor_lr=5e-5),"
error"TypeError: init() got an unexpected keyword argument 'stop_factor_lr'" what does it mean?
and I use your mxnet version

Training LightCNN-29 with CASIA-WebFaces

Use the code in verification dir to train LightCNN-29. When Training LightCNN-29 with CASIA, we can see: the training loss decreases slowly, and the training/valing accuracy increase also slowly. And, training/valing accuracy is always close to 0.0000.
Could you give some advises to speed the training phase, and some for increase the train/val accuracy?
For example, the initialization methods for init the weights, the learning rate scheduler, and so on.
Thanks

train-acc only increase in first epoch

I compile Mxnet face version ,and train with run.sh ,but train-acc only increase in first epoch .

INFO:root:Namespace(batch_size=256, data_dir='D:\mxnet_train\casiaa_alfred_aligned', gpus='0', kv_store='local', lr=0.0001, model_load_epoch=1, model_load_prefix='D:\mxnet_train\model\0525\alfred_aligned', model_save_prefix='D:\mxnet_train\model\0525\alfred_aligned', num_examples=432815, retrain=True)
INFO:root:Start training with [gpu(0)]
INFO:root:Epoch[0] Batch [100] Speed: 336.65 samples/sec Train-accuracy=0.645898
INFO:root:Epoch[0] Batch [200] Speed: 331.79 samples/sec Train-accuracy=0.663164
INFO:root:Epoch[0] Batch [300] Speed: 332.34 samples/sec Train-accuracy=0.668242
INFO:root:Epoch[0] Batch [400] Speed: 335.01 samples/sec Train-accuracy=0.693711
INFO:root:Epoch[0] Batch [500] Speed: 334.37 samples/sec Train-accuracy=0.699023
INFO:root:Epoch[0] Batch [600] Speed: 332.04 samples/sec Train-accuracy=0.712734
INFO:root:Epoch[0] Batch [700] Speed: 332.06 samples/sec Train-accuracy=0.719727
INFO:root:Epoch[0] Batch [800] Speed: 332.64 samples/sec Train-accuracy=0.737969
INFO:root:Epoch[0] Batch [900] Speed: 332.11 samples/sec Train-accuracy=0.748594
INFO:root:Epoch[0] Batch [1000] Speed: 333.26 samples/sec Train-accuracy=0.759297
INFO:root:Epoch[0] Batch [1100] Speed: 333.02 samples/sec Train-accuracy=0.779766
INFO:root:Epoch[0] Batch [1200] Speed: 332.66 samples/sec Train-accuracy=0.787852
INFO:root:Epoch[0] Batch [1300] Speed: 333.59 samples/sec Train-accuracy=0.802188
INFO:root:Epoch[0] Batch [1400] Speed: 331.93 samples/sec Train-accuracy=0.808555
INFO:root:Epoch[0] Batch [1500] Speed: 334.06 samples/sec Train-accuracy=0.828867
INFO:root:Epoch[0] Batch [1600] Speed: 331.78 samples/sec Train-accuracy=0.846172
INFO:root:Update[1691]: Change learning rate to 7.00000e-05
INFO:root:Epoch[0] Resetting Data Iterator
INFO:root:Epoch[0] Time cost=1301.951
INFO:root:Saved checkpoint to "D:\mxnet_train\model\0525\alfred_aligned-0001.params"
INFO:root:Epoch[1] Batch [100] Speed: 335.75 samples/sec Train-accuracy=0.394023
INFO:root:Epoch[1] Batch [200] Speed: 333.30 samples/sec Train-accuracy=0.404844
INFO:root:Epoch[1] Batch [300] Speed: 332.97 samples/sec Train-accuracy=0.392188
INFO:root:Epoch[1] Batch [400] Speed: 333.99 samples/sec Train-accuracy=0.405156
INFO:root:Epoch[1] Batch [500] Speed: 333.78 samples/sec Train-accuracy=0.402422
INFO:root:Epoch[1] Batch [600] Speed: 332.24 samples/sec Train-accuracy=0.411250
INFO:root:Epoch[1] Batch [700] Speed: 333.50 samples/sec Train-accuracy=0.414883
INFO:root:Epoch[1] Batch [800] Speed: 332.92 samples/sec Train-accuracy=0.423516
INFO:root:Epoch[1] Batch [900] Speed: 332.78 samples/sec Train-accuracy=0.423867
INFO:root:Epoch[1] Batch [1000] Speed: 330.80 samples/sec Train-accuracy=0.432031
INFO:root:Epoch[1] Batch [1100] Speed: 334.11 samples/sec Train-accuracy=0.439883
INFO:root:Epoch[1] Batch [1200] Speed: 334.03 samples/sec Train-accuracy=0.447852
INFO:root:Epoch[1] Batch [1300] Speed: 333.42 samples/sec Train-accuracy=0.456641
INFO:root:Epoch[1] Batch [1400] Speed: 334.37 samples/sec Train-accuracy=0.454023
INFO:root:Epoch[1] Batch [1500] Speed: 333.05 samples/sec Train-accuracy=0.464219
INFO:root:Epoch[1] Batch [1600] Speed: 332.09 samples/sec Train-accuracy=0.476289
INFO:root:Epoch[1] Resetting Data Iterator
INFO:root:Epoch[1] Time cost=1298.563
INFO:root:Saved checkpoint to "D:\mxnet_train\model\0525\alfred_aligned-0002.params"
INFO:root:Epoch[2] Batch [100] Speed: 337.55 samples/sec Train-accuracy=0.372266
INFO:root:Epoch[2] Batch [200] Speed: 333.14 samples/sec Train-accuracy=0.380742
INFO:root:Epoch[2] Batch [300] Speed: 333.10 samples/sec Train-accuracy=0.367578
INFO:root:Epoch[2] Batch [400] Speed: 331.97 samples/sec Train-accuracy=0.375937
INFO:root:Epoch[2] Batch [500] Speed: 333.65 samples/sec Train-accuracy=0.376563
INFO:root:Epoch[2] Batch [600] Speed: 333.32 samples/sec Train-accuracy=0.379492
INFO:root:Epoch[2] Batch [700] Speed: 332.77 samples/sec Train-accuracy=0.375469
INFO:root:Epoch[2] Batch [800] Speed: 332.36 samples/sec Train-accuracy=0.381328
INFO:root:Epoch[2] Batch [900] Speed: 333.27 samples/sec Train-accuracy=0.380625
INFO:root:Epoch[2] Batch [1000] Speed: 332.74 samples/sec Train-accuracy=0.382031
INFO:root:Epoch[2] Batch [1100] Speed: 332.61 samples/sec Train-accuracy=0.382539
INFO:root:Epoch[2] Batch [1200] Speed: 331.58 samples/sec Train-accuracy=0.386680
INFO:root:Epoch[2] Batch [1300] Speed: 333.37 samples/sec Train-accuracy=0.392227
INFO:root:Epoch[2] Batch [1400] Speed: 332.36 samples/sec Train-accuracy=0.392734
INFO:root:Epoch[2] Batch [1500] Speed: 332.56 samples/sec Train-accuracy=0.389766
INFO:root:Epoch[2] Batch [1600] Speed: 333.80 samples/sec Train-accuracy=0.398555
INFO:root:Epoch[2] Resetting Data Iterator
INFO:root:Epoch[2] Time cost=1298.782
INFO:root:Saved checkpoint to "D:\mxnet_train\model\0525\alfred_aligned-0003.params"
INFO:root:Epoch[3] Batch [100] Speed: 334.17 samples/sec Train-accuracy=0.371758
INFO:root:Epoch[3] Batch [200] Speed: 333.79 samples/sec Train-accuracy=0.381953
INFO:root:Epoch[3] Batch [300] Speed: 332.77 samples/sec Train-accuracy=0.371523
INFO:root:Epoch[3] Batch [400] Speed: 330.89 samples/sec Train-accuracy=0.379844
INFO:root:Epoch[3] Batch [500] Speed: 332.51 samples/sec Train-accuracy=0.377305
INFO:root:Epoch[3] Batch [600] Speed: 332.82 samples/sec Train-accuracy=0.382734
INFO:root:Epoch[3] Batch [700] Speed: 333.12 samples/sec Train-accuracy=0.379844
INFO:root:Epoch[3] Batch [800] Speed: 332.58 samples/sec Train-accuracy=0.384102
INFO:root:Epoch[3] Batch [900] Speed: 330.25 samples/sec Train-accuracy=0.385234

Attribute Training

Hi

I was wondering if it is possible to train the modele only for some attributes ( for example train only the gender and the color of hair ) ?

Having trouble installing the modified mxnet

Hi, I am having trouble installing the modified mxnet. Do you have any recommended way to do that?
What I do is to use the install-mxnet-osx-python.sh and replace the MXNET_GITPATH in it to yours github.

打扰下,运行时出现da symbol = sym.load('%s-symbol.json' % prefix)错误

打扰下,运行时出现如下错误,请问是啥原因造成的啊?

Traceback (most recent call last):
File "predict.py", line 85, in
main()
File "predict.py", line 16, in main
_, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/model.py", line 363, in load_checkpoint
symbol = sym.load('%s-symbol.json' % prefix)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/symbol.py", line 958, in load
check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle)))
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/base.py", line 77, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: Failed loading Op Moon of type MoonOutput: [17:07:13] src/operator/operator.cc:19: Cannot find Operator MoonOutput in registry

Using Moon_Output to train vgg-face but can't work at all

I want to implement the original Moon using the vgg-face net and your moon-loss function.But it didn't work and report no error just show training down.I do the following change based on your code.
(1)I choose to use the crop_aligned images from the CeleA database.
(2)When generate the .rec file, i use the resize=178 color=1 to resize and read RGB images.
(3)I chang the weight of your loss funtion all to 1.0 to following the original Moon.
(4)I choose vgg-face and just simply change the output layer to the new moon-output

I use the new moon-ouput to train your LCNN ,works well .But when i use the for my vgg-face net ,I show no error but just show train down 👍
[12:45:47] src/io/iter_image_recordio.cc:68: Loaded ImageList from /media/mt02/data1/dataset/CelebA/celeba_train.lst 162770 Image records
[12:45:47] src/io/iter_image_recordio.cc:211: ImageRecordIOParser: ./celeba_train.rec, use 3 threads for decoding..
[12:45:47] src/io/iter_image_recordio.cc:68: Loaded ImageList from /media/mt02/data1/dataset/CelebA/celeba_val.lst 19867 Image records
[12:45:47] src/io/iter_image_recordio.cc:211: ImageRecordIOParser: ./celeba_val.rec, use 3 threads for decoding..
INFO:root:Start training with [cpu(0)]
Start training with [cpu(0)]
trining done!

attached the training code i used

`def norm_stat(d):
return mx.nd.norm(d)/np.sqrt(d.size)
mon = mx.mon.Monitor(10, norm_stat)

def get_symbol(num_classes = 40):
## define alexnet
data = mx.symbol.Variable(name="data")
# group 1
conv1_1 = mx.symbol.Convolution(data=data, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_1")
relu1_1 = mx.symbol.Activation(data=conv1_1, act_type="relu", name="relu1_1")
conv1_2 = mx.symbol.Convolution(data=relu1_1, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_2")
relu1_2 = mx.symbol.Activation(data=conv1_2, act_type="relu", name="relu1_2")
pool1 = mx.symbol.Pooling(data=relu1_2, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool1")
# group 2
conv2_1 = mx.symbol.Convolution(data=pool1, kernel=(3, 3), pad=(1, 1), num_filter=128, name="conv2_1")
relu2_1 = mx.symbol.Activation(data=conv2_1, act_type="relu", name="relu2_1")
conv2_2 = mx.symbol.Convolution(data=pool1, kernel=(3, 3), pad=(1, 1), num_filter=128, name="conv2_2")
relu2_2 = mx.symbol.Activation(data=conv2_1, act_type="relu", name="relu2_2")
pool2 = mx.symbol.Pooling(data=relu2_1, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool2")
# group 3
conv3_1 = mx.symbol.Convolution(data=pool2, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_1")
relu3_1 = mx.symbol.Activation(data=conv3_1, act_type="relu", name="relu3_1")
conv3_2 = mx.symbol.Convolution(data=relu3_1, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_2")
relu3_2 = mx.symbol.Activation(data=conv3_2, act_type="relu", name="relu3_2")
conv3_3 = mx.symbol.Convolution(data=relu3_2, kernel=(3, 3), pad=(1, 1), num_filter=256, name="conv3_3")
relu3_3 = mx.symbol.Activation(data=conv3_3, act_type="relu", name="relu3_3")
pool3 = mx.symbol.Pooling(data=relu3_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool3")
# group 4
conv4_1 = mx.symbol.Convolution(data=pool3, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_1")
relu4_1 = mx.symbol.Activation(data=conv4_1, act_type="relu", name="relu4_1")
conv4_2 = mx.symbol.Convolution(data=relu4_1, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_2")
relu4_2 = mx.symbol.Activation(data=conv4_2, act_type="relu", name="relu4_2")
conv4_3 = mx.symbol.Convolution(data=relu4_2, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv4_3")
relu4_3 = mx.symbol.Activation(data=conv4_3, act_type="relu", name="relu4_3")
pool4 = mx.symbol.Pooling(data=relu4_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool4")
# group 5
conv5_1 = mx.symbol.Convolution(data=pool4, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_1")
relu5_1 = mx.symbol.Activation(data=conv5_1, act_type="relu", name="relu5_1")
conv5_2 = mx.symbol.Convolution(data=relu5_1, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_2")
relu5_2 = mx.symbol.Activation(data=conv5_2, act_type="relu", name="relu5_2")
conv5_3 = mx.symbol.Convolution(data=relu5_2, kernel=(3, 3), pad=(1, 1), num_filter=512, name="conv5_3")
relu5_3 = mx.symbol.Activation(data=conv5_3, act_type="relu", name="relu5_3")
pool5 = mx.symbol.Pooling(data=relu5_3, pool_type="max", kernel=(2, 2), stride=(2,2), name="pool5")
# group 6
f1c6 = mx.symbol.FullyConnected(data=pool5, num_hidden=4096, name="f1c6",attr={'lr_mult':'0.1'})
relu6 = mx.symbol.Activation(data=f1c6, act_type="relu", name="relu6")
drop6 = mx.symbol.Dropout(data=relu6, p=0.5, name="drop6")
# group 7
f1c7 = mx.symbol.FullyConnected(data=drop6, num_hidden=4096, name="f1c7",attr={'lr_mult':'0.1'})
relu7 = mx.symbol.Activation(data=f1c7, act_type="relu", name="relu7")
drop7 = mx.symbol.Dropout(data=relu7, p=0.5, name="drop7")
# output
f1c8 = mx.symbol.FullyConnected(data=drop7, num_hidden=num_classes, name="f1c8",attr={'lr_mult':'0.1'})
moon = mx.symbol.MoonOutput(data=f1c8, src_dist_path='./src_dict.txt', name='Moon')
return moon

def main():

logging

if 'log_file' in args and args.log_file is not None:
    log_file = args.log_file
    log_dir = args.log_dir
    log_file_full_name = os.path.join(log_dir, log_file)
    if not os.path.exists(log_dir):
        os.mkdir(log_dir)
    logger = logging.getLogger()
    handler = logging.FileHandler(log_file_full_name)
    logger.addHandler(handler)
    handler = logging.StreamHandler()
    logger.addHandler(handler)
    logger.setLevel(logging.DEBUG)
    logger.info('start with arguments %s', args)
else:
    logging.basicConfig(level=logging.DEBUG, format=head)
    logging.info('start with arguments %s', args)
# symbol = lightened_moon(num_classes=40, use_fuse=False)
symbol = get_symbol(num_classes=40)
devs = mx.cpu() if args.gpus is None else [mx.gpu(int(i)) for i in args.gpus.split(',')]
epoch_size = args.num_examples / args.batch_size
checkpoint = mx.callback.do_checkpoint(args.model_save_prefix)
kv = mx.kvstore.create(args.kv_store)
arg_params = None
aux_params = None
if args.retrain:
    _, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)
train = mx.io.ImageRecordIter(
    path_imglist = args.list_dir + 'celeba_train.lst',
    path_imgrec = args.data_dir + "celeba_train.rec",
    label_width = 40,
    data_name   = 'data',
    label_name  = 'Moon_label',
    data_shape  = (3, 178, 178),
    scale       = 1./255,
    batch_size  = args.batch_size,
    rand_crop   = True,
    rand_mirror = True,
    num_parts   = kv.num_workers,
    part_index  = kv.rank)
val = mx.io.ImageRecordIter(
    path_imglist = args.list_dir + 'celeba_val.lst',
    path_imgrec = args.data_dir + "celeba_val.rec",
    label_width = 40,
    data_name   = 'data',
    label_name  = 'Moon_label',
    batch_size  = args.batch_size,
    data_shape  = (3, 178, 178),
    scale       = 1./255,
    rand_crop   = False,
    rand_mirror = False,
    num_parts   = kv.num_workers,
    part_index  = kv.rank)
model = mx.model.FeedForward(
    ctx                = devs,
    symbol             = symbol,
    arg_params         = arg_params,
    aux_params         = aux_params,
    num_epoch          = 100,
    begin_epoch        = args.model_load_epoch,
    learning_rate      = args.lr,
    momentum           = 0.9,
    wd                 = 0.00001,
    lr_scheduler       = mx.lr_scheduler.FactorScheduler(step=4*max(int(epoch_size * 1), 1), factor=0.8, stop_factor_lr=1e-5),
    initializer        = mx.init.Xavier(factor_type="in", magnitude=2.34)
    )
model.fit(
    X                  = train,
    eval_data          = val,
    eval_metric        = ['multi_binary_acc'],
    kvstore            = kv,
    batch_end_callback = mx.callback.Speedometer(args.batch_size, 10),
    epoch_end_callback = checkpoint)
    # monitor            = mon)`

running detection on multiple core using tornado giving segmentation 11 fault

Segmentation fault: 11 Stack trace returned 10 entries: [bt] (0) 0 libmxnet.so 0x0000000116ef741f _ . ZN5mxnet15segfault_loggerEi + 63 [bt] (1) 1 libsystem_platform.dylib 0x00007fff6ce4af5a _sigtramp + 26 [bt] (2) 2 libsystem_malloc.dylib 0x00007fff6cd73cc0 malloc_zone_calloc + 87 [bt] (3) 3 CarbonCore 0x00007fff46798117 _ZL22connectToCoreServicesDv + 258 [ bt] (4) 4 CarbonCore 0x00007fff46797fe4 _ZL9getStatusv + 24 [bt] (5) 5 CarbonCore 0x00007fff46797f62 scCreateSystemServiceVersion + 49 [bt] (6) 6 CarbonCore 0x00007fff46799392 FileIDTreeGetCachedPort + 2 1 [bt] (7) 7 CarbonCore 0x00007fff467991f2 FSNodeStorageGetAndLockCurrentUniverse + 79 [bt] (8) 8 CarbonCore 0x00007fff46799080 FileIDTreeGetAndLockVolumeEntryForDeviceID + 38 [bt] (9) 9 CarbonCore 0x00007fff46798fdd _ZN7FSMountC2Ej17FSMountNumberTypePiPKj + 75 child 3 (pid 42579) exited with status 255, restarting

About using GPU for detection

I used 'detection.py' for making a test, and found processing on one image spent about 0.24s. I wonder 'detection.py' used GPU for detecting human face ? Or CPU ? Where can I make a setup for using GPU or CPU by myself ?

Thank you.

How to transpose GPU like param file to CPU param file

when i use cpu mode amalgamation to forward the trained net, i can use the lightened_cnn_cpu-0166.params, but can't use lightened_cnn-0166.params, it says:
mxnet_predict-all.cc:569: [09:58:51] mxnet_predict-all.cc:17594: GPU is not enabled
mxnet_predict-all.cc:569: [09:58:51] mxnet_predict-all.cc:18433: GPU is not enabled
terminate called after throwing an instance of 'dmlc::Error'
what(): [09:58:51] mxnet_predict-all.cc:18433: GPU is not enabled

how do i train a CPU like params? Only use CPU? It will cost a lot of time?
or can i transpose a GPU params to CPU params? how? Thanks!

Error running test.sh

I tried testing the model on lfw and got the following error message.

Here is what I've done:

  1. modified the test.sh. Changed align_data_path to my own folder which contains aligned lfw images of size 96*96
  2. modified the default size to 96
  3. deleted the predict.txt
  4. ran ./test.sh

INFO:root:Namespace(epoch=166, lfw_align='/home/vic/Projects/openface/data/lfw/dlib-affine-sz:96', model_prefix='../model/lightened_cnn/lightened_cnn', pairs='./pairs.txt', predict_file='./predict.txt', size=96, suffix='png')
Loading embeddings done
INFO:root:begin generate the predict.txt.
...Reading pairs.
INFO:root:processing name1:Abel_Pacheco/Abel_Pacheco_0001.png <---> name2:Abel_Pacheco/Abel_Pacheco_0004.png
Traceback (most recent call last):
File "lfw.py", line 152, in
main()
File "lfw.py", line 147, in main
get_predict_file(args)
File "lfw.py", line 103, in get_predict_file
exector = symbol.bind(ctx, model_args ,args_grad=None, grad_req="null", aux_states=model_auxs)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/symbol.py", line 839, in bind
ctypes.byref(handle)))
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/base.py", line 77, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: InferShape Error in fc1's weight argument
Corresponding keyword of symbol: fc1_weight
Shape inconsistent, Provided =(512,2048), inferred shape=(512,1152)

your slightly changed mxnet branch face Link failure,I can‘t open it

I want to train the model,but
Traceback (most recent call last):
File "lightened_moon.py", line 147, in
main()
File "lightened_moon.py", line 74, in main
symbol = lightened_moon(num_classes=40, use_fuse=True)
File "lightened_moon.py", line 69, in lightened_moon
moon = mx.symbol.MoonOutput(data=fc2, src_dist_path='./src_dict.txt', name='Moon')
AttributeError: 'module' object has no attribute 'MoonOutput'
trining done!

关于moon loss

大神,你实现的moonloss和作者论文里提到的不一样吧?

请教如何修改light-moon?

你好,请问如果我只想用celebA数据训练cnn来预测40 个face attribute,应该如何修改light-moon模型啊?是不是不需要fuse就ok?还有就是最后同时有40个output,现有的方法是不是通过moon output来实现的啊?

Error predicting the face attribute

when I run the script

python -u predict.py --img ./crowd.jpg

to predict face attribute, I got the error:

INFO:root:Namespace(gpus=None, img='./crowd.jpg', model_load_epoch=82, model_load_prefix='../model/lightened_moon/lightened_moon_fuse', opencv='../model/opencv/cascade.xml', pad=None, size=128) [15:05:33] /home/xz/dev/mxnet/dmlc-core/include/dmlc/logging.h:235: [15:05:33] src/operator/operator.cc:19: Cannot find Operator MoonOutput in registry

Probably some operator define files were missing and cannot be recognized by MXNet. Has anyone managed to resolve this issue?

Thanks,
Edward

res

how can i load in c++?
I tried to load and get error..

[12:02:24] C:\mxnet\dmlc-core\include\dmlc/logging.h:300: [12:02:24] c:\mxnet\src\operator./custom-inl.h:127: Check failed: registry_.find(param_.op_type) != registry_.end() Cannot find custom operator type proposal

error message related to Moon

Hello, I encountered the error messages with the following comment:
python -u predict.py --img aaa.jpg
/home/user/mxnet/lib/python3.6/distutils/init.py:4: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
INFO:root:Namespace(gpus=None, img='aaa.jpg', model_load_epoch=82, model_load_prefix='../model/lightened_moon/lightened_moon_fuse', opencv='../model/opencv/cascade.xml', pad=None, size=128)
Traceback (most recent call last):
File "predict.py", line 83, in
main()
File "predict.py", line 14, in main
_, arg_params, aux_params = mx.model.load_checkpoint(args.model_load_prefix, args.model_load_epoch)
File "/usr/local/lib/python3.6/dist-packages/mxnet/model.py", line 419, in load_checkpoint
symbol = sym.load('%s-symbol.json' % prefix)
File "/usr/local/lib/python3.6/dist-packages/mxnet/symbol/symbol.py", line 2535, in load
check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle)))
File "/usr/local/lib/python3.6/dist-packages/mxnet/base.py", line 149, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: Failed loading Op Moon of type MoonOutput: [18:33:52] src/core/op.cc:55: Check failed: op != nullptr Operator MoonOutput is not registered

Stack trace returned 10 entries:
[bt] (0) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x1c05f2) [0x7f0b787145f2]
[bt] (1) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x4842a55) [0x7f0b7cd96a55]
[bt] (2) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x4874311) [0x7f0b7cdc8311]
[bt] (3) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x4879420) [0x7f0b7cdcd420]
[bt] (4) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x4872ff6) [0x7f0b7cdc6ff6]
[bt] (5) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x295ebdf) [0x7f0b7aeb2bdf]
[bt] (6) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x4845cdd) [0x7f0b7cd99cdd]
[bt] (7) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x295fc71) [0x7f0b7aeb3c71]
[bt] (8) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x295ebdf) [0x7f0b7aeb2bdf]
[bt] (9) /usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so(+0x4845cdd) [0x7f0b7cd99cdd]

Environment: python 3.6.5 + mxnet version 1.2.0

This error seems to be related to issue #50 as well. Please help!

demo.sh ran into error

My env is Ubuntu 14.04, Python 3.4, CUDA8.0. I have the following errors,

(mxnet) ubuntu@deepcam:~/mxnet-face/detection$ ./demo.sh
[15:07:06] /home/travis/build/dmlc/mxnet-distro/mxnet-build/dmlc-core/include/dmlc/logging.h:308: [15:07:06] /home/travis/build/dmlc/mxnet-distro/mxnet-build/dmlc-core/include/dmlc/././json.h:639: Check failed: ch == '{' (60 vs. {) Error at Line 0, around ^!DOCTYPE html><html lang="en" xmlns:fb="http://ogp.me/ns/fb#" x, Expect '{' but get '<'

Stack trace returned 10 entries:
[bt] (0) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x1d57cc) [0x7f9849e697cc]
[bt] (1) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d7b7ff) [0x7f984ca0f7ff]
[bt] (2) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d88c56) [0x7f984ca1cc56]
[bt] (3) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d82ec6) [0x7f984ca16ec6]
[bt] (4) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xf9aa1f) [0x7f984ac2ea1f]
[bt] (5) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d58f78) [0x7f984c9ecf78]
[bt] (6) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xf94ead) [0x7f984ac28ead]
[bt] (7) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xf9aa1f) [0x7f984ac2ea1f]
[bt] (8) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d58f78) [0x7f984c9ecf78]
[bt] (9) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xe0fcae) [0x7f984aaa3cae]

Traceback (most recent call last):
File "detection.py", line 97, in
main()
File "detection.py", line 47, in main
_, arg_params, aux_params = mx.model.load_checkpoint(args.prefix, args.epoch)
File "/home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/model.py", line 394, in load_checkpoint
symbol = sym.load('%s-symbol.json' % prefix)
File "/home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/symbol.py", line 1900, in load
check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle)))
File "/home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/base.py", line 129, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [15:07:06] /home/travis/build/dmlc/mxnet-distro/mxnet-build/dmlc-core/include/dmlc/././json.h:639: Check failed: ch == '{' (60 vs. {) Error at Line 0, around ^!DOCTYPE html><html lang="en" xmlns:fb="http://ogp.me/ns/fb#" x, Expect '{' but get '<'

Stack trace returned 10 entries:
[bt] (0) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x1d57cc) [0x7f9849e697cc]
[bt] (1) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d7b7ff) [0x7f984ca0f7ff]
[bt] (2) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d88c56) [0x7f984ca1cc56]
[bt] (3) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d82ec6) [0x7f984ca16ec6]
[bt] (4) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xf9aa1f) [0x7f984ac2ea1f]
[bt] (5) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d58f78) [0x7f984c9ecf78]
[bt] (6) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xf94ead) [0x7f984ac28ead]
[bt] (7) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xf9aa1f) [0x7f984ac2ea1f]
[bt] (8) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0x2d58f78) [0x7f984c9ecf78]
[bt] (9) /home/ubuntu/anaconda3/envs/mxnet/lib/python3.4/site-packages/mxnet/libmxnet.so(+0xe0fcae) [0x7f984aaa3cae]

[15:07:06] src/engine/engine.cc:54: MXNet start using engine: NaiveEngine
[15:07:06] src/engine/naive_engine.cc:53: Engine shutdown

Can somebody help take a look at what it is? What is correct env to make it run?
Thanks a lot.

关于mxnet-face

请问你所用的mxnet都做了哪些修改?
因为我两三个前页尝试过用mxnet实现lightcnn但是失败了,很想知道为什么会失败。

the result.txt of running get_predict_file is different from your predict.txt

Hi, i have run verification/test.sh again with your provided data 'aligin-lfw dataset'. The new predicted result is different your verification/predict.txt and its acc is very bad.

  • your provided predict.txt
Abel_Pacheco/Abel_Pacheco_0001.png  Abel_Pacheco/Abel_Pacheco_0004.png  0.451991    1
Akhmed_Zakayev/Akhmed_Zakayev_0001.png  Akhmed_Zakayev/Akhmed_Zakayev_0003.png  0.835496    1
Akhmed_Zakayev/Akhmed_Zakayev_0002.png  Akhmed_Zakayev/Akhmed_Zakayev_0003.png  0.714418    1
Amber_Tamblyn/Amber_Tamblyn_0001.png    Amber_Tamblyn/Amber_Tamblyn_0002.png    0.694672    1
Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0001.png    Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0003.png    0.618321    1
Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0001.png    Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0004.png    0.610199    1
Angela_Bassett/Angela_Bassett_0001.png  Angela_Bassett/Angela_Bassett_0005.png  0.826952    1
Angela_Bassett/Angela_Bassett_0002.png  Angela_Bassett/Angela_Bassett_0005.png  0.550906    1
Angela_Bassett/Angela_Bassett_0003.png  Angela_Bassett/Angela_Bassett_0004.png  0.45209 1
Ann_Veneman/Ann_Veneman_0003.png    Ann_Veneman/Ann_Veneman_0005.png    0.877394    1
Ann_Veneman/Ann_Veneman_0006.png    Ann_Veneman/Ann_Veneman_0010.png    0.758687    1
Ann_Veneman/Ann_Veneman_0010.png    Ann_Veneman/Ann_Veneman_0011.png    0.58771 1
Anthony_Fauci/Anthony_Fauci_0001.png    Anthony_Fauci/Anthony_Fauci_0002.png    0.788583    1
Antony_Leung/Antony_Leung_0001.png  Antony_Leung/Antony_Leung_0002.png  0.669878    1
Antony_Leung/Antony_Leung_0002.png  Antony_Leung/Antony_Leung_0003.png  0.609032    1
Anwar_Ibrahim/Anwar_Ibrahim_0001.png    Anwar_Ibrahim/Anwar_Ibrahim_0002.png    0.533982    1
  • my new predict
Abel_Pacheco/Abel_Pacheco_0001.png  Abel_Pacheco/Abel_Pacheco_0004.png  0.999479    1
Akhmed_Zakayev/Akhmed_Zakayev_0001.png  Akhmed_Zakayev/Akhmed_Zakayev_0003.png  0.999885    1
Akhmed_Zakayev/Akhmed_Zakayev_0002.png  Akhmed_Zakayev/Akhmed_Zakayev_0003.png  0.999717    1
Amber_Tamblyn/Amber_Tamblyn_0001.png    Amber_Tamblyn/Amber_Tamblyn_0002.png    0.999251    1
Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0001.png    Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0003.png    0.999579    1
Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0001.png    Anders_Fogh_Rasmussen/Anders_Fogh_Rasmussen_0004.png    0.999673    1
Angela_Bassett/Angela_Bassett_0001.png  Angela_Bassett/Angela_Bassett_0005.png  0.999726    1
Angela_Bassett/Angela_Bassett_0002.png  Angela_Bassett/Angela_Bassett_0005.png  0.999633    1
Angela_Bassett/Angela_Bassett_0003.png  Angela_Bassett/Angela_Bassett_0004.png  0.999088    1
Ann_Veneman/Ann_Veneman_0003.png    Ann_Veneman/Ann_Veneman_0005.png    0.999508    1
Ann_Veneman/Ann_Veneman_0006.png    Ann_Veneman/Ann_Veneman_0010.png    0.999353    1
Ann_Veneman/Ann_Veneman_0010.png    Ann_Veneman/Ann_Veneman_0011.png    0.999434    1
Anthony_Fauci/Anthony_Fauci_0001.png    Anthony_Fauci/Anthony_Fauci_0002.png    0.99928 1
Antony_Leung/Antony_Leung_0001.png  Antony_Leung/Antony_Leung_0002.png  0.999453    1
Antony_Leung/Antony_Leung_0002.png  Antony_Leung/Antony_Leung_0003.png  0.99954 1
Anwar_Ibrahim/Anwar_Ibrahim_0001.png    Anwar_Ibrahim/Anwar_Ibrahim_0002.png    0.999303    1

The only change is that

  1. i use the newest mxnet, not your provided face_mxnet;
  2. i use io.imread instead of 'cv2.imread'

Is there any import notice i ignore? Any hits will be appreciated.
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.