-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use the pretrained JSTL+DGD model for person re-identification? #14
Comments
Our model does not directly produces the binary verification result of a pair of people. During test stage, we first go through all the images, and extract their features using our net. Then we compute the pairwise Euclidean distances between query and gallery people. At last, for each query, we just rank the gallery samples based on their distances. If you just wish to do the verification, you can choose a distance threshold that balances the true positive rate and false positive rate. |
I tried to follow your suggestions, but my result is not convincing. I made some experiments with the PRID dataset. In the multi shot case, I choose 2 pictures of persons 4 and 9, taken with cameras A and B (8 pictures in total). We should get a large distance between pictures of different persons, and a small distance between pictures of the same person, but this is not the case. Why? Some results are here (for example, a4_1.png is picture number 1 of person 4 by camera A): distance between a4_1.png and a9_1.png: 6.65493 Cropped images are here (cropped to shape (56,144) for input in the neural network): Code (additional code here: `from jstl_inference import JSTL # jstl_inference.py is the TensorFlow version of the file jstl_dgd_deploy_inference.prototxt , made with Caffe-Tensorflow #https://github.com/ethereon/caffe-tensorflow import tensorflow as tf #Preparation of the feature extractor x = tf.placeholder(tf.float32, shape=[1, 144, 56, 3]) net = JSTL({'data': x}) person_feature = sess.graph.get_tensor_by_name("fc7/fc7:0") #gets the output from the layer FC7 def extract_vector(image_data):
def distance_pics(photo1,photo2): #Results distance_pics('a4_1.png','a9_1.png') distance_pics('a4_1.png','b4_1.png') distance_pics('b9_1.png','a4_34.png') |
I guess there might be some mismatch between the image preprocessing methods we used. When training the model, we use opencv to read the image, and subtract the mean pixel values. The input data to the CNN should be a 1x3x144x56 image, whose color channels are in BGR order, and are demeaned by [102, 102, 101]. Thanks for providing the script. I will verify this after the cvpr deadline. |
I revised my image pre-processing, but the result does not improve. My result is: distance between a4_1.png and a9_1.png: 6.59645 My code is: `from jstl_inference import JSTL # the output python script of caffe2tensorflow import numpy as np import cv2 x = tf.placeholder(tf.float32, shape=[1,144, 56, 3]) net = JSTL({'data': x}) person_feature = sess.graph.get_tensor_by_name("fc7/fc7:0") def preprocess(image): #Crop on both sides
`# subtract the mean pixel values
def extract_vector(image):
def distance_pics(photo1,photo2): #Results: distance_pics('a4_1.png','a9_1.png') distance_pics('a4_1.png','b4_1.png') distance_pics('b9_1.png','a4_34.png') |
I've encountered the same problem. It seems that the feature layer outputs I got from using tensorflow and caffe are different. |
Which prototxt in the code was used to train model for jstl_dgd_inference.caffemodel? I can't seem to find it |
I don't understand how to do person re-identification with the pretrained JSTL+DGD model found here: https://drive.google.com/open?id=0B67_d0rLRTQYZnB5ZUZpdTlxM0k
I have two problems, one related to input, one related to output :
But here, in the file 'jstl_dgd_deploy_inference.prototxt', the input data is (1,3,144,56) and not, for example, (2,3,144,56).
Moreover, when loading the caffemodel weights, I receive the warnings:
I1108 08:48:31.324759 1525 net.cpp:752] Ignoring source layer relu7
I1108 08:48:31.324795 1525 net.cpp:752] Ignoring source layer drop7
I1108 08:48:31.324802 1525 net.cpp:752] Ignoring source layer fc8_jstl
This suggests that something is missing in the prototxt file.
The text was updated successfully, but these errors were encountered: