Skip to content
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

Face detection using my own dataset #90

Closed
PiyalGeorge opened this issue May 18, 2018 · 2 comments
Closed

Face detection using my own dataset #90

PiyalGeorge opened this issue May 18, 2018 · 2 comments

Comments

@PiyalGeorge
Copy link
Contributor

PiyalGeorge commented May 18, 2018

Hi, I'm new to machine learning, caffe, LMDB stuffs. Currently i'm trying to create a caffemodel using mobilenet ssd, using my own dataset. I'm using OpenImage's face dataset (Eg: open-image-dataset). When i extracted this dataset, i'm getting CSV files that has data in it, unlike the Annotations(xml files, etc). Anyway i downloaded the images. Now how should i create the LMDB with theses images? I want to detect person and faces from video. During LMDB we use some labelmap.prototxt file(actually what does this file do?) . how will we create this file for so many images?
Also incase if i have created this LMDB, how will i train a pretrained mobilenet ssd model with these LMDB to get the right detections results?

Please bro @chuanqi305 , help me. I have been looking for this for days. but still not getting the right answer

@chuanqi305
Copy link
Owner

@PiyalGeorge Firstly, you should convert the labels to voc format like this:

VOC2007
000001.jpg

The VOC2007 Database
PASCAL VOC2007
flickr
341012865


Fried Camels
Jinky the Fruit Bat


353
500
3

0

dog
Left
1
0

48
240
195
371



person
Left
1
0

8
12
352
498


And then generate label list file train.txt , val.txt and test.txt.
The labelmap.prototxt is used to convert the class name in xml to id.

@PiyalGeorge
Copy link
Contributor Author

PiyalGeorge commented May 18, 2018

First of all i thank you @chuanqi305 for coming to help me.
I didn't get the use of that much of text files . @chuanqi305 this is what i have done:- from the Openimage's CSV dataset in above link, i have created the xml file for each image and stored in another folder. I downloaded all images to a folder. then i created a text file(one text file only) with <path_to_image>SPACE<path_to_its_xml_file> information.

The xml file looks like this:- 0a0c1f65f19859c0.xml ->

<annotation>
   	<folder>COCO</folder>
  	<filename>0a0c1f65f19859c0.jpeg</filename>
  	<source>
  		<database>The VOC2007 Database</database>
  		<annotation>PASCAL VOC2007</annotation>
  		<image>flickr</image>
  	</source>
  	<size>
  		<width>512</width>
  		<height>512</height>
  		<depth>3</depth>
  	</size>
  	<segmented>1</segmented>
  	<object>
  		<name>face</name>
  		<pose>Unspecified</pose>
  		<truncated>0</truncated>
  		<difficult>0</difficult>
  		<bndbox>
  			<xmin>216</xmin>
  			<ymin>0</ymin>
  			<xmax>278</xmax>
  			<ymax>64</ymax>
  		</bndbox>
  	</object>
        <object>
  		<name>person</name>
  		<pose>Unspecified</pose>
  		<truncated>0</truncated>
  		<difficult>0</difficult>
  		<bndbox>
  			<xmin>210</xmin>
  			<ymin>0</ymin>
  			<xmax>434</xmax>
  			<ymax>512</ymax>
  		</bndbox>
  	</object>
</annotation>

theni created a labelmap.prototxt on my own with following entries only:
item {
name: "none_of_the_above"
label: 0
display_name: "background"
}
item {
name: "person"
label: 1
display_name: "person"
}
item {
name: "face"
label: 2
display_name: "face"
}

in
So inputs now i have are - 1) Images 2)xml-files 3)text file that map image and xml file 4) labelmap.prototxt.
then i gave this command to create the LMDB:-

/caffe/build/tools/convert_annoset --anno_type=detection --label_type=xml --label_map_file=/home/Documents/labelmap_voc.prototxt --check_label=True --min_dim=0 --max_dim=0 --resize_height=0 --resize_width=0 --backend=lmdb --shuffle=False --check_size=False --encode_type=jpeg --encoded=True --gray=False /home/PATH_TO_DATA/ /home/Documents/mobile-ssd/text.txt /home/lmdb/VOC0712_test_lmdb

Here VOC0712_test_lmdb is the name of lmdb to be created.

But during these procedures where do i encounter train.txt , val.txt and test.txt ?
Also i dont know whether i'm doing things right. Please correct me bro @chuanqi305 if i'm going wrong. I will be eagerly waiting for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants