Giter VIP home page Giter VIP logo

ssh's Introduction

SSH: Single Stage Headless Face Detector

Introduction

This repository includes the code for training and evaluating the SSH face detector introduced in our ICCV 2017 paper.

alt text The code is adapted based on an intial fork from the py-faster-rcnn repository.

Citing

If you find SSH useful in your research please consider citing:

@inproceedings{najibi2017ssh,
title={{SSH}: Single Stage Headless Face Detector},
author={Najibi, Mahyar and Samangouei, Pouya and Chellappa, Rama and Davis, Larry},
booktitle={The IEEE International Conference on Computer Vision (ICCV)},
year={2017}
}

Contents

  1. Installation
  2. Running the demo
  3. Training a model
  4. Evaluting a trained model

Installation

  1. Clone the repository:
git clone --recursive https://github.com/mahyarnajibi/SSH.git
  1. Install cuDNN and NCCL (used for multi-GPU training).

  2. Caffe and pycaffe: You need to compile the caffe-ssh repository which is a Caffe fork compatible with SSH. Caffe should be built with cuDNN, NCCL, and python layer support (set by default in Makefile.config.example). You also need to make pycaffe.

  3. Install python requirements:

pip install -r requirements.txt
  1. Run make in the lib directory:
cd lib
make

Running the demo

To run the demo, first, you need to download the provided pre-trained SSH model. Running the following script downloads the SSH model into its default directory path:

bash scripts/download_ssh_model.sh

By default, the model is saved into a folder named data/SSH_models (you can create a symbolic link for data if you plan to use an external path).

After downloading the SSH model, you can run the demo with the default configuration as follows:

python demo.py

If everything goes well, the following detections should be saved as data/demo/demo_detections_SSH.png.

For a list of possible options run: python demo.py --help

Training a model

For training on the WIDER dataset, you need to download the WIDER face training images and the face annotations from the dataset website. These files should be copied into data/datasets/wider/ (you can create symbolic links if you prefer to store the actual data somewhere else).

You also need to download the pre-trained VGG-16 ImageNet model. The following script downloads the model into the default directory:

bash scripts/download_imgnet_model.sh

Before starting to train you should have a directory structure as follows:

data
  |--datasets
        |--wider
            |--WIDER_train/
            |--wider_face_split/
  |--imagenet_models
        |--VGG16.caffemodel

For training with the default parameters, you can call the main_train module with a list of GPU ids. As an example:

python main_train.py --gpus 0,1,2,3

For a list of all possible options run python main_train.py --help.

Please note that the default training parameters (e.g. number of iterations, stepsize, and learning rate) are set for training on 4 GPUs as described in the paper.

All SSH default settings and configurations (saved in SSH/configs/default_config.yml) can be overwritten by passing an external configuration file to the module (--cfg [path-to-config-file]. See SSH/configs for example config files).

By default, the models are saved into the output/[EXP_DIR]/[db_name]/ folder (EXP_DIR is set to ssh by default and can be changed through the configuration files, and db_name would be wider_train in this case).

Evaluating a trained model

The evaluation on the WIDER dataset is based on the official WIDER evaluation tool which requires MATLAB. you need to download the validation images and the annotations (if not downloaded for training) from the WIDER dataset website. These files should be copied into the data/datasets/wider directory as follows:

data
  |--datasets
        |--wider
            |--WIDER_val/
            |--wider_face_split/

The evaluation can be performed with the default configuration by calling the main_test module:

python main_test.py --model [path-to-the-trained-model]

For a list of possible options run python main_test.py --help.

All SSH default settings and configurations (saved inSSH/configs/default_config.yml) can be overwritten by passing an external configuration file to the module (--cfg [path-to-config-file]. See SSH/configs for example config files).

The evaluation outputs are saved into output/[EXP_DIR]/[db_name]/[net_name] (EXP_DIR is set to ssh by default and can be changed by passing a config file, net_name can be directly passed to the module and is set to SSH by default, and db_name would be wider_val in this case). This includes the detections saved as text files in a folder named detections,detections saved as a pickle file, and the WIDER evaluation plots saved in a folder named wider_plots.

Please note that the detections will be cached by default and will not be re-computed again (the caching can be disabled by passing the --no_cache argument.)

ssh's People

Contributors

mahyarnajibi avatar po0ya 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssh's Issues

what's the conv5_128_crop for?

hi Mahyar,
I've tried to achieve your paper before you release your code, but i didn't get the accuracy as you got. Mabye some details made my accuracy fall, I'm trying to figure it out. I see there is a 'con5_128_crop' layer in your net. What's work it does? How about if I remove it?

best regards!

compile caffe error

Hi, when I ran 'make all' to compile ssh-caffe, error as follows:

/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002bba_00000000-19_contrastive_loss_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/contrastive_loss_layer.o] 错误 1
make: *** 正在等待未完成的任务....
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002bc4_00000000-19_exp_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/exp_layer.o] 错误 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002c1a_00000000-19_im2col_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/im2col_layer.o] 错误 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002c27_00000000-19_slice_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/slice_layer.o] 错误 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002c7e_00000000-19_crop_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/crop_layer.o] 错误 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002ce6_00000000-19_split_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/split_layer.o] 错误 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002cf3_00000000-19_hdf5_data_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/hdf5_data_layer.o] 错误 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/include/cuda_fp16.h(3068): error: calling a constexpr host function("isinf") from a device function("__float_simpl_sinf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/usr/local/cuda/include/cuda_fp16.h(3079): error: calling a constexpr host function("isinf") from a device function("__float_simpl_cosf") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

2 errors detected in the compilation of "/tmp/tmpxft_00002d42_00000000-19_scale_layer.compute_61.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/scale_layer.o] 错误 1

Any help?Thanks

Feature map fusion without channel reduction?

Hi @po0ya and @mahyarnajibi ,

Firstly, thank you for the discussion in my previous post earlier! I definitely benefited from learning from you!

I have a question regarding channel reduction and would be glad if you can share your suggestions. In the paper, it was written, "...to decrease the memory consumption of the model, the number of channels in the feature map is reduced from 512 to 128 using 1 x 1 convolutions."
I am trying to run an experiment when only feature map fusion is done (without reducing channels). However, by doing so, I encountered exploded gradient. Of course, one possible direction is to reduce learning rate but I try not to do that yet as I suspect I may have implemented prototxt incorrectly or I might have missed out something that I did not realize... may I know if nan loss was encountered too in your experiment when channels are not reduced?

Iteration 20 (1.09985 iter/s, 18.1843s/20 iters), loss = nan
Train net output #0: m1@ssh_cls_loss = 87.3365 (* 1 = 87.3365 loss)
Train net output #1: m1@ssh_reg_loss = nan (* 1 = nan loss)
Train net output #2: m2@ssh_cls_loss = 87.3365 (* 1 = 87.3365 loss)
Train net output #3: m2@ssh_reg_loss = nan (* 1 = nan loss)
Train net output #4: m3@ssh_cls_loss = 87.3365 (* 1 = 87.3365 loss)
Train net output #5: m3@ssh_reg_loss = nan (* 1 = nan loss)

Prototxt modification is as follows:

#==========CONV4 Backwards for M1======

# Upsample conv5_3
layer {
  name: "conv5_3_up"
  type: "Deconvolution"
  bottom: "conv5_3"
  top: "conv5_3_up"
  convolution_param {
    kernel_size: 4 
    stride: 2
    num_output: 512
    group: 512
    pad: 1
    weight_filler: { type: "bilinear" } 
    bias_term: false
  }
  param { lr_mult: 0 decay_mult: 0 }
}



# Crop conv5_3
layer {
  name: "conv5_3_crop"
  type: "Crop"
  bottom: "conv5_3_up"
  bottom: "conv4_3"
  top: "conv5_3_crop"
  crop_param {
    axis: 2
    offset: 0
  }
}

# Eltwise summation
layer {
  name: "conv4_fuse"
  type: "Eltwise"
  bottom: "conv5_3_crop"
  bottom: "conv4_3"
  top: "conv4_fuse"
  eltwise_param {
    operation: SUM
  }
}
# Perform final 3x3 convolution
layer {
  name: "conv4_fuse_final"
  type: "Convolution"
  bottom: "conv4_fuse"
  top: "conv4_fuse_final"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  convolution_param {
    num_output: 512
    pad: 1
    kernel_size: 3
    weight_filler { type: "gaussian" std: 0.01 }
    bias_filler { type: "constant" value: 0 }
  }
}
layer {
  name: "conv4_fuse_final_relu"
  type: "ReLU"
  bottom: "conv4_fuse_final"
  top: "conv4_fuse_final"
}

Several bugs may exist

Hi,
Here's some problems may exist.
1. The total loss doesn't equal to the sum of all loss when training.
2. the reg_loss of m3 is 0 while the cls_loss of m3 is not.
Can you explain these?

Message type "caffe.LayerParameter" has no field named "smooth_l1_loss_param".

Hello, I down the VGG16.caffemodel with the download_imgnet_model.sh,when I run the main_train.py, it comes with the error:
Error parsing text-format caffe.NetParameter: 849:24: Message type "caffe.LayerParameter" has no field named "smooth_l1_loss_param".
How can I deal with it,Thanks very much for your nice code and your help

About train my own data

I try to train SSH using my own data.My training data is about 10k.

To get the better detection result,should I change the hyperparameters,

like the epochs, batch_size, learinging rate...?

can't load VGG16.caffemodel

Thank you for your great job.
I tried to train my own model, when i ran python main_train.py --gpus 2,3, get the error below:

15:03:44.585690 12330 net.cpp:255] Network initialization done.
I0716 15:03:44.586588 12330 solver.cpp:56] Solver scaffolding done.
Loading pretrained model weights from data/imagenet_models/VGG16.caffemodel
Loading pretrained model weights from data/imagenet_models/VGG16.caffemodel
F0716 15:03:45.152788 12330 upgrade_proto.cpp:95] Check failed: ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: data/imagenet_models/VGG16.caffemodel
F0716 15:03:45.152806 12331 upgrade_proto.cpp:95] Check failed: ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: data/imagenet_models/VGG16.caffemodel
*** Check failure stack trace: ***
*** Check failure stack trace: ***
@ 0x7fb0e5dfa5cd google::LogMessage::Fail()
@ 0x7fb0e5dfa5cd google::LogMessage::Fail()
@ 0x7fb0e5dfc433 google::LogMessage::SendToLog()
@ 0x7fb0e5dfc433 google::LogMessage::SendToLog()
@ 0x7fb0e5dfa15b google::LogMessage::Flush()
@ 0x7fb0e5dfa15b google::LogMessage::Flush()
@ 0x7fb0e5dfce1e google::LogMessageFatal::~LogMessageFatal()
@ 0x7fb0e5dfce1e google::LogMessageFatal::~LogMessageFatal()
@ 0x7fb0e68e92c1 caffe::ReadNetParamsFromBinaryFileOrDie()
@ 0x7fb0e68e92c1 caffe::ReadNetParamsFromBinaryFileOrDie()
@ 0x7fb0e69549ea caffe::Net<>::CopyTrainedLayersFromBinaryProto()
@ 0x7fb0e69549ea caffe::Net<>::CopyTrainedLayersFromBinaryProto()
@ 0x7fb0e6954ad7 caffe::Net<>::CopyTrainedLayersFrom()
@ 0x7fb0e6954ad7 caffe::Net<>::CopyTrainedLayersFrom()
@ 0x7fb0e705c508 boost::python::objects::caller_py_function_impl<>::operator()()
@ 0x7fb0e705c508 boost::python::objects::caller_py_function_impl<>::operator()()
@ 0x7fb0e58bb5cd boost::python::objects::function::call()
@ 0x7fb0e58bb5cd boost::python::objects::function::call()
@ 0x7fb0e58bb7c8 (unknown)
@ 0x7fb0e58bb7c8 (unknown)
@ 0x7fb0e58c3613 boost::python::handle_exception_impl()
@ 0x7fb0e58c3613 boost::python::handle_exception_impl()
@ 0x7fb0e58b8999 (unknown)
@ 0x4c15bf PyEval_EvalFrameEx
@ 0x4b9ab6 PyEval_EvalCodeEx
@ 0x4d55f3 (unknown)
@ 0x4eebee (unknown)
@ 0x4ee7f6 (unknown)
@ 0x4aa9ab (unknown)
@ 0x4c15bf PyEval_EvalFrameEx
@ 0x4b9ab6 PyEval_EvalCodeEx
@ 0x7fb0e58b8999 (unknown)
@ 0x4d55f3 (unknown)
@ 0x4a577e PyObject_Call
@ 0x4bed3d PyEval_EvalFrameEx
@ 0x4c15bf PyEval_EvalFrameEx
@ 0x4c136f PyEval_EvalFrameEx
@ 0x4b9ab6 PyEval_EvalCodeEx
@ 0x4c136f PyEval_EvalFrameEx
@ 0x4b9ab6 PyEval_EvalCodeEx
@ 0x4d55f3 (unknown)
@ 0x4d54b9 (unknown)
@ 0x4eebee (unknown)
@ 0x4eebee (unknown)
@ 0x4ee7f6 (unknown)
@ 0x4ee7f6 (unknown)
@ 0x4aa9ab (unknown)
@ 0x4aa9ab (unknown)
@ 0x4c15bf PyEval_EvalFrameEx
@ 0x4b9ab6 PyEval_EvalCodeEx
@ 0x4c15bf PyEval_EvalFrameEx
@ 0x4d55f3 (unknown)
@ 0x4c136f PyEval_EvalFrameEx
@ 0x4a577e PyObject_Call
@ 0x4bed3d PyEval_EvalFrameEx
@ 0x4c136f PyEval_EvalFrameEx
@ 0x4c136f PyEval_EvalFrameEx
@ 0x4b9ab6 PyEval_EvalCodeEx
@ 0x4d54b9 (unknown)
@ 0x4eebee (unknown)
@ 0x4ee7f6 (unknown)
@ 0x4aa9ab (unknown)
@ 0x4c15bf PyEval_EvalFrameEx
@ 0x4c136f PyEval_EvalFrameEx
done solving!

I used the latest version of caffe-ssh.
can you give me some advices?

why the iteration is 21K ?

the training part of wider face dataset is about 15K
and the batch size is 1, using 4 GPUs,
the iteration is setting to 21K to get the best result.
how did the 21K come from?

ahout anchor_target_layer.py

@po0ya
@mahyarnajibi

# keep only inside anchors
if inds_inside.shape[0]==0:
    # If no anchors inside use whatever anchors we have
    inds_inside = np.arange(0,all_anchors.shape[0])

Why use all anchors when there are no inside anchors???
hope your reply!!!

Error for unzip the model

hi,
I met the error of the compressed model file, SSH_models.tar.gz.
gzip: stdin: unexpected end of file
SSH_models/
SSH_models/SSH.caffemodel
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

can not reproduce the detection result in paper for WIDER hard subset

@mahyarnajibi,
I tried detection using the latest code with model in download_ssh_model.sh. On WIDER validation set I got 92.5/90.9/73.7 respectively for easy/medium/hard subset. That is not consistent with results in paper: 91.9/90.9/81.4. Particularly for hard subset, the gap(81.4 vs. 73.7) is significant.
I also trained the model from scratch, the detection performances are 92.3/90.5/72.7. Result on hard subset differ much from 81.4.
Is there any specific setting for hard subset I am missing?
thank!

adding another detection layer on conv3_3

Dear @mahyarnajibi and @po0ya, I was wondering if during implementation, have you guys experimented adding another detection layer at conv3_3 which has feat_stride: 4? Since wider face consists a lot of small faces. If yes, could you please share some insights? many many thanks.

demo.py crashes

After following your installation procedure, I tried to run python demo.py. Unfortunately, this crashes with the following error:

#################### Configuration ####################
USE_GPU_NMS:  True
DATA_DIR:  ./SSH/data
GPU_ID:  0
EPS:  1e-14
DEBUG:  False
MATLAB:  matlab
TEST{
    NMS_THRESH:  0.3
    SCALES:  [500, 800, 1200, 1600]
    ANCHOR_MIN_SIZE:  0
    N_DETS_PER_MODULE:  1000
    PYRAMID_BASE_SIZE:  [800, 1200]
    ORIG_SIZE:  False
    MAX_SIZE:  -1
}
ROOT_DIR:  ./SSH
EXP_DIR:  ssh_pyramid
PIXEL_MEANS:  [[[ 102.9801  115.9465  122.7717]]]
RNG_SEED:  3
#######################################################
WARNING: Logging before InitGoogleLogging() is written to STDERR
W1031 11:13:32.679569  2292 _caffe.cpp:139] DEPRECATION WARNING - deprecated use of Python interface
W1031 11:13:32.679675  2292 _caffe.cpp:140] Use this instead (with the named "weights" parameter):
W1031 11:13:32.679689  2292 _caffe.cpp:142] Net('SSH/models/test_ssh.prototxt', 1, weights='data/SSH_models/SSH.caffemodel')
I1031 11:13:32.685971  2292 upgrade_proto.cpp:67] Attempting to upgrade input file specified using deprecated input fields: SSH/models/test_ssh.prototxt
I1031 11:13:32.686033  2292 upgrade_proto.cpp:70] Successfully upgraded file specified using deprecated input fields.
W1031 11:13:32.686048  2292 upgrade_proto.cpp:72] Note that future Caffe releases will only support input layers and not input fields.
I1031 11:13:32.687358  2292 net.cpp:51] Initializing net from parameters: 
name: "SSH"
state {
  phase: TEST
  level: 0
}
... 
I1031 11:13:33.332159  2292 net.cpp:200] input does not need backward computation.
I1031 11:13:33.332171  2292 net.cpp:242] This network produces output ssh_boxes
I1031 11:13:33.332183  2292 net.cpp:242] This network produces output ssh_cls_prob
I1031 11:13:33.332281  2292 net.cpp:255] Network initialization done.
I1031 11:13:33.457337  2292 net.cpp:744] Ignoring source layer ssh_cls_score
Loading the network...Done!
F1031 11:13:34.977154  2292 blob.cpp:37] Check failed: shape[i] <= 2147483647 / count_ (2400 vs. 2333) blob size exceeds INT_MAX
*** Check failure stack trace: ***
Aborted (core dumped)

Can you reproduce this error?

GPU configuration for SSH

Hi Guys,

I was wondering what GPU gpu card did you used in your experiments? I am using a GTX 970M. Even tried several configurations (/SSH/Configs) but none of them worked and I still finding out of memory error from cuda. I am using cuda 8.0 and cudnn 6.0.

#################### Configuration ####################
USE_GPU_NMS: True
DATA_DIR: /home/bockholt/probes/ssh-faceDetector/data
GPU_ID: 0
EPS: 1e-14
DEBUG: False
MATLAB: matlab
TEST{
NMS_THRESH: 0.3
SCALES: [1200]
ANCHOR_MIN_SIZE: 0
N_DETS_PER_MODULE: 1000
PYRAMID_BASE_SIZE: [800, 1200]
ORIG_SIZE: False
MAX_SIZE: 1600
}
ROOT_DIR: /home/bockholt/probes/ssh-faceDetector
EXP_DIR: ssh
PIXEL_MEANS: [[[102.9801 115.9465 122.7717]]]
RNG_SEED: 3
#######################################################
Loading the network...Done!
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0119 16:57:22.624498 4045 syncedmem.cpp:71] Check failed: error == cudaSuccess (2 vs. 0) out of memory
*** Check failure stack trace: ***
Aborted (core dumped)

caffe compiling error SmoothL1LossParameter

Hi,

i am trying to compile your caffe branch to test the code but i get the following error, complaining that "SmoothL1LossParameter" is not found.. here is my output:

CXX src/caffe/layers/smooth_l1_loss_layer.cpp
src/caffe/layers/smooth_l1_loss_layer.cpp:10:3: error: unknown type name 'SmoothL1LossParameter'; did you mean 'SmoothL1LossLayer'?
SmoothL1LossParameter loss_param = this->layer_param_.smooth_l1_loss_param();
^~~~~~~~~~~~~~~~~~~~~
SmoothL1LossLayer
./include/caffe/layers/smooth_l1_loss_layer.hpp:22:7: note: 'SmoothL1LossLayer' declared here
class SmoothL1LossLayer : public LossLayer {
^
src/caffe/layers/smooth_l1_loss_layer.cpp:10:57: error: no member named 'smooth_l1_loss_param' in 'caffe::LayerParameter'
SmoothL1LossParameter loss_param = this->layer_param_.smooth_l1_loss_param();
~~~~~~~~~~~~~~~~~~ ^
src/caffe/layers/smooth_l1_loss_layer.cpp:62:19: note: in instantiation of member function 'caffe::SmoothL1LossLayer::LayerSetUp' requested here
INSTANTIATE_CLASS(SmoothL1LossLayer);
^
src/caffe/layers/smooth_l1_loss_layer.cpp:10:57: error: no member named 'smooth_l1_loss_param' in 'caffe::LayerParameter'
SmoothL1LossParameter loss_param = this->layer_param_.smooth_l1_loss_param();
~~~~~~~~~~~~~~~~~~ ^
src/caffe/layers/smooth_l1_loss_layer.cpp:62:19: note: in instantiation of member function 'caffe::SmoothL1LossLayer::LayerSetUp' requested here
INSTANTIATE_CLASS(SmoothL1LossLayer);
^
3 errors generated.
make: *** [.build_release/src/caffe/layers/smooth_l1_loss_layer.o] Error 1

do you have any idea what this could be? should i modify the .hpp file to add some new things?
any help is appreciated!
Thanks!!

FDDB dataset

@mahyarnajibi
@po0ya
HI

Section 4.4 points out:
Moreover, HR-ER and Conv3D both generate ellipses to decrease the localization error. In contrast, SSH does not use FDDB for training, and is evaluated on this dataset out-of-the-box by generating bounding boxes

Does this mean in the test, SSH use a rectangular result directly? There is no conversion of rectangular box to elliptical box

How to config training on one GPU

Hi,
I have encounter several questions when training on one gpu.

  1. Where to change learning rate? I cant find learning rate para in config files.
  2. I keep encounter this error:
    Traceback (most recent call last):
    File "main_train.py", line 63, in
    max_iter=args.iters, gpus=gpus)
    File "/SSH/SSH/train.py", line 167, in train_net
    uid = caffe.NCCL.new_uid()
    AttributeError: type object 'NCCL' has no attribute 'new_uid'
    Thanks

type object 'NCCL' has no attribute 'new_uid'

when i run python main_train.py --gpus 0,1,2,3. I have the problem
Traceback (most recent call last): File "main_train.py", line 63, in <module> max_iter=args.iters, gpus=gpus) File "/home/lavi/deepcode/face/SSH/SSH/train.py", line 167, in train_net uid = caffe.NCCL.new_uid() AttributeError: type object 'NCCL' has no attribute 'new_uid'
How to solve it? Please help me.

about bbox_transform.py

@mahyarnajibi
@po0ya
HI

In bbox_transform.py, about bbox_transform_inv(boxes, deltas):

    potential_of = np.where(dw>100)[0]
    try:
        pred_w = np.exp(dw) * widths[:, np.newaxis]
        pred_h = np.exp(dh) * heights[:, np.newaxis]
    except(FloatingPointError):
        print 'WARNING: OVERFLOW OCCURED IN np.exp(dw) and/or np.exp(dh)'
        for i in xrange(dw.shape[0]):
            for j in xrange(dw.shape[1]):
                if dw[i][j]>50:
                    dw[i][j]=5
                if dh[i][j]>50:
                    dh[i][j]=5
        pred_w = np.exp(dw) * widths[:, np.newaxis]
        pred_h = np.exp(dh) * heights[:, np.newaxis]

Why consider this judgment(dw[i][j]>50, dh[i][j]>50)? When does this happen?

many many thanks!!

download pretrain model error

when I run "download_ssh_model.sh",it return
Length: 73481470 (70M), 530494 (518K) remaining [application/gzip]
Saving to: ‘./data/SSH_models.tar.gz’

./data/SSH_models.tar.gz 100%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] 70.08M 28.0KB/s in 23s

2018-06-08 08:04:51 (22.8 KB/s) - ‘./data/SSH_models.tar.gz’ saved [73481470/73481470]

Done!
Unzipping the file...
SSH_models/
SSH_models/SSH.caffemodel

gzip: stdin: invalid compressed data--format violated
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Cleaning up...
All done!

the model cannot be extraced, could you please help me? or upload the model to another Network disk?
Thank you

performance drops when i make some changes in SSH

hi, sth bothers me is that when i make some changes in ur code (these changes work in other face detection network), the performance drops.
any tricks in ur code?
and i wonder why iter=21000, the model achieves the best performance. above 21000, it drops.

hope i can get ur reply asap.

How to definite the Concat layer with three repeated propagate_down=false in python?

what if I want to write this?
layer{
name: "m3@ssh_output_ohem"
type: "Concat"
bottom: "m3@ssh_3x3_output_ohem"
bottom: "m3@ssh_5x5_output_ohem"
bottom: "m3@ssh_7x7_output_ohem"
top: "m3@ssh_output_ohem"
concat_param{
axis: 1
}
propagate_down: false
propagate_down: false
propagate_down: false
}
There are three# propagate_down: false, and python can not receive the duplicate args.
How to write in python?
name = 'm3@ssh_output_ohem'
net[name] = L.Concat(net['m3@ssh_3x3_output_ohem'], net['m3@ssh_5x5_output_ohem'], net['m3@ssh_7x7_output_ohem'], propagate_down=False,propagate_down=False, propagate_down=False, name='m3@ssh_output_ohem', concat_param=dict(axis=1))

The model released seems go wrong;

Using the .sh file to get the model,end up with a error and a less than 30M caffe.model that can't be parsed,bellow is the info.
./data/SSH_models.tar.gz 100%[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=>] 70.08M 56.1KB/s in 38s

2018-03-20 21:13:17 (25.3 KB/s) - ‘./data/SSH_models.tar.gz’ saved [73481470/73481470]

Done!
Unzipping the file...
SSH_models/
SSH_models/SSH.caffemodel

gzip: stdin: invalid compressed data--format violated
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Cleaning up...
All done!

Also I try to manually downloaded the .tar.gz file ,no way to unzip it ,both Windows and linux failed;

How about other Networks?

Hi, besides VGG-16, have you tried any other Networks, such as ResNet, DenseNet or DualPathNet?
I have tried resnet101 and densenet92 by replacing the corresponding layers in vgg16. It's a pity these results are not good enough. Do you have any good suggestions?

why many faces of animals are deteted?

Dear author, when I use the pre-trained VGG-SSH model to detect the faces in my own datasets, many heads or faces of some animals like cat, dog are extracted. It seems that the model has a relatived high false positive compared with cascade CNN.

What's the exact training batch size using default setting?

when i run the paper and the code.
i am confused about the batch size.
in the default_config.yml file, i saw the TRAING BATCH SIZE, which equals to 128.
and the default iter_size in the solver_ssh.prototxt is 2.
But in paper, the 4 GPUs are using a mini-batch of 4 images?

so, what's the number of mini-batch ?

About training?

I trained wider according to the introduction, but tested it on the generated model. Why didn't face be detected?

._caffe not found

After runnnig make in libs, i get this error in demo.py

ImportError: No module named _caffe

I don't have caffe installed. Is it because of that or something else?

Could this run on CPU?

Hi, I was interested in using this on my MacBook, 2.3ghz, 16gb ram. Do you think it could run (the pretrained model)? Is there a lot in the model I would need to change? Thanks!

No face frame detected

I used the model by our training to test and no face frame is detected. In the process of training, the loss of
layer m3@ssh_reg_loss is zero. I have no idea about it. Any help?

SSH for multi class classification

SSH is proposed as binary classification (face and bg). Can it be extended smoothly for more than two classes with this implementation? Where will be the change in this implementation.

Currently, I am training for 6 classes and I changed the num_classes field in SSH/models/train.protobuf.

Any comments?

test pretrain model

hi, I tested one picture based on your pretrain model and compare the result with Tiny Face Detector, CVPR 2017(https://github.com/peiyunh/tiny). In your paper, the performance is better than Tiny face,but it seems that the performance is not better than Tiny face. I am wonder if anything wrong with the way I use the model Or something I need pay more attention when I use the model? Thank you very much.

python demo.py error!!!

F1030 11:30:52.953382 7873 blob.cpp:34] Check failed: shape[i] <= 0x7fffffff / count_ (2400 vs. 2333) blob size exceeds INT_MAX
*** Check failure stack trace: ***
Aborted (core dumped)

About the GPU memory?

hi,
I want to know how much GPU memory we need when test the model? A problem has been encountered, "Check failed: error == cudaSuccess (2 vs. 0) out of memory", our GPU is k80. I find the model just about 70M and just test one image, i don't why when i execute forwatd_net the error occured.

how can I run the demo on cpu?

Thank you for your great work.
I compiled the caffe-ssh only on cpu successfully, but when i ran import caffe, encountered error:Segmentation fault: 11.
systerm: macos
Can you give me some advices?

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.