thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

How to customize the label names? #617

Open tangziqiao opened 6 years ago

tangziqiao commented 6 years ago

I'm trying to change all the label names to my own words, but still using the pre-trained model they provide. I'm using the tiny-yolo-voc. Where exactly is the label name file of this weights and how do I actually substitute the original names with my own?

Thank you for the help!!

ghost commented 6 years ago

https://github.com/thtrieu/darkflow/blob/master/darkflow/net/yolo/misc.py check this file, and just modify the code below as you like


labels20 = ["aeroplane", "bicycle", "bird", "boat", "bottle",
    "bus", "car", "cat", "chair", "cow", "diningtable", "dog",
    "horse", "motorbike", "person", "pottedplant", "sheep", "sofa",
    "train", "tvmonitor"]
tangziqiao commented 6 years ago

@troydeng Thank you sooooo much!! It works like a charm!

rezaabdullah commented 6 years ago

Hi,

Thanks for quick response. After editing the file I keep getting bounding box with label: "??????Person". May I know what could be the problem?

Regards Abdullah Reza


From: tangziqiao notifications@github.com Sent: Thursday, March 8, 2018 1:55 AM To: thtrieu/darkflow Cc: Subscribed Subject: Re: [thtrieu/darkflow] How to customize the label names? (#617)

@troydenghttps://github.com/troydeng Thank you sooooo much!! It works like a charm!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/thtrieu/darkflow/issues/617#issuecomment-371408838, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AffFLETS4IiMfM5ndn7OfRj48WX7EwIPks5tcOP5gaJpZM4SiFjZ.

ghost commented 6 years ago

@rezaabdullah you just added this piece of code?

####################
##added by me
if max_indx != 14:
     continue
####################
SagiShaashua commented 6 years ago

in the same direction, is there a way to count the labels? like 'car 1', 'car 2'.... thanks :)

MenshikovDmitry commented 5 years ago

Just in case someone needs to customize the labels for one of the other models, entire list of names is in https://github.com/thtrieu/darkflow/blob/master/darkflow/cfg/coco.names