I am following the racoon detection tutorial from GitHub (https://github.com/datitran/raccoon_dataset) to detect animals using google object detection API. For this, I need to generate tfrecord file which is already generated here on line number 29 to 34 (https://github.com/datitran/raccoon_dataset/blob/master/generate_tfrecord.py).
But he has done the code for only one animal (racoon) line 29 to 34. I have multiple animals like a racoon, praying mantis, hermit crab etc how do I modify this tfrecord file for multiple animals. One way I found is making changes to line 29 to 34 in generatetfrecord file as follows
def class_text_to_int(row_label):
if row_label == 'raccoon':
return 1
if row_label == 'prayingmantis':
return 2
else:
None
Is this approach corect to include multiple if in same file or I need to generate multiple tfrecord files to train multiple objects
def class_text_to_int(row_label):
if row_label == 'raccoon':
return 1
elif row_label == 'prayingmantis':
return 2
else:
None
Making the above change in generatetfrecord is a correct approach to train multiple custom images simultaniously. Also, in object detection.pbtxt file, make the following changes:
item{
id:1
name:'racoon'
}
item{
id:2
name: 'prayingmantis'
}
And retrain the model from the first step.