Darknet: Class suppression

Created on 28 Dec 2018  Â·  6Comments  Â·  Source: AlexeyAB/darknet

It would be a nice feature to pass an argument with the only class that you want to show. For example

-class 0
or
-class class_show.txt

The only problem is that we have to change the functionality in multiple functions. As I saw, there are multiple functions used to show regarding the specific backend.

enhancement

Most helpful comment

@dimimal I added this fix:

Use dont_show in the obj.data file to disable detection for a specific class.
For example, there will be detected all classes except person:

dont_show person
bicycle
car
motorbike
aeroplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign
parking meter
bench
bird
cat
dog
horse
sheep
cow
elephant
bear
zebra
giraffe
backpack
umbrella
handbag
tie
suitcase
frisbee
skis
snowboard
sports ball
kite
baseball bat
baseball glove
skateboard
surfboard
tennis racket
bottle
wine glass
cup
fork
knife
spoon
bowl
banana
apple
sandwich
orange
broccoli
carrot
hot dog
pizza
donut
cake
chair
sofa
pottedplant
bed
diningtable
toilet
tvmonitor
laptop
mouse
remote
keyboard
cell phone
microwave
oven
toaster
sink
refrigerator
book
clock
vase
scissors
teddy bear
hair drier
toothbrush

All 6 comments

On 28.12.2018 15:53, Dimitris Mallios wrote:
>

It would be a nice feature to pass an argument with the only class
that you want to show. For example

-class 0
or
-class class_show.txt

The only problem is that we have to change the functionality in
multiple functions. As I saw, there are multiple functions used to
show regarding the specific backend.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/AlexeyAB/darknet/issues/2122, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHjhQzwccJ_SGz1STeNXAhiERMSAGTiwks5u9jB7gaJpZM4Zj7df.

You can do your filtering on the results you get back from yolo. That
"feature" shouldnt become part of yolo imho.

@dimimal
May be I will add such feature, in such a way that class will not be detected if its name started from dont_show in the obj.names file.

@AlexeyAB
That's what I thought. Can you give me directions, in which file or function should I have a look and make some changes to upload a PR?

@dimimal I added this fix:

Use dont_show in the obj.data file to disable detection for a specific class.
For example, there will be detected all classes except person:

dont_show person
bicycle
car
motorbike
aeroplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign
parking meter
bench
bird
cat
dog
horse
sheep
cow
elephant
bear
zebra
giraffe
backpack
umbrella
handbag
tie
suitcase
frisbee
skis
snowboard
sports ball
kite
baseball bat
baseball glove
skateboard
surfboard
tennis racket
bottle
wine glass
cup
fork
knife
spoon
bowl
banana
apple
sandwich
orange
broccoli
carrot
hot dog
pizza
donut
cake
chair
sofa
pottedplant
bed
diningtable
toilet
tvmonitor
laptop
mouse
remote
keyboard
cell phone
microwave
oven
toaster
sink
refrigerator
book
clock
vase
scissors
teddy bear
hair drier
toothbrush

Use dont_show in the obj.data file to disable detection for a specific class.
For example, there will be detected all classes except person:

@AlexeyAB , Thanks for this enhancement. I was looking for the same thing and found this.

Could you please clarify the following, post this fix,

  1. Does the the mAP and F1 scores also take care of only the shown classes?
  2. The training still happens with this "dont_show" class but only during the inference the "dont_show" mentioned class is suppressed?
  3. Can I have the class name as "dont_show _someClass1_" during the training time as well (for custom training)? OR should I have it as " _someClass1_" only during custom training time and change it to "dont_show _someClass1_" during inference time? I assume the later is the case?
  4. Can I use class suppression technique to reduce some commonly mistaken objects (false positives)?

@kmsravindra

  1. mAP and F1 will be calculated for all classes
  2. Training will for all classes
  3. It doesn't affect on training
  4. I don't know, how can it help to reduce FP?
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jacky3213 picture Jacky3213  Â·  3Comments

jasleen137 picture jasleen137  Â·  3Comments

louisondumont picture louisondumont  Â·  3Comments

Yumin-Sun-00 picture Yumin-Sun-00  Â·  3Comments

HanSeYeong picture HanSeYeong  Â·  3Comments