Darknet: How to show one label only even though it detects all the objects

Created on 8 Mar 2018  Â·  3Comments  Â·  Source: AlexeyAB/darknet

Hi AlexeyAB,

How to show only one label? Let's say for example,
I am using tiny-yolo model which detects 20 object classes. However instead of showing bounding box i.e. labels for all the object classes, is it possible to show only one object class? Let's say a picture contains Persons, dog, bicycle and cars. Once done it only shows bounding box for the person although it detects all the other objects.

Most helpful comment

@rezaabdullah

Also the simplest way is to do these changes, if you want to detect persons only:

  1. Change this line: https://github.com/AlexeyAB/darknet/blob/100d6f78011f0a773442411e2882a0203d390585/src/image.c#L193
  2. And this line: https://github.com/AlexeyAB/darknet/blob/100d6f78011f0a773442411e2882a0203d390585/src/image.c#L251
  • to this if (prob > thresh && class_id == 14) { if you use yolo-voc.weights (14 is number of line in the file voc.names where is person)

  • or to this if (prob > thresh && class_id == 0) { if you use yolo.weights (0 is number of line in the file coco.names where is person)

All 3 comments

Not sure if this will solve your issue but check it out https://github.com/AlexeyAB/darknet/issues/385#issuecomment-366102993

@rezaabdullah

Also the simplest way is to do these changes, if you want to detect persons only:

  1. Change this line: https://github.com/AlexeyAB/darknet/blob/100d6f78011f0a773442411e2882a0203d390585/src/image.c#L193
  2. And this line: https://github.com/AlexeyAB/darknet/blob/100d6f78011f0a773442411e2882a0203d390585/src/image.c#L251
  • to this if (prob > thresh && class_id == 14) { if you use yolo-voc.weights (14 is number of line in the file voc.names where is person)

  • or to this if (prob > thresh && class_id == 0) { if you use yolo.weights (0 is number of line in the file coco.names where is person)

Tq


From: Alexey notifications@github.com
Sent: Thursday, March 8, 2018 5:23 AM
To: AlexeyAB/darknet
Cc: rezaabdullah; Mention
Subject: Re: [AlexeyAB/darknet] How to show one label only even though it detects all the objects (#433)

@rezaabdullahhttps://github.com/rezaabdullah

Also the simplest way is to do these changes, if you want to detect persons only:

  1. Change this line: https://github.com/AlexeyAB/darknet/blob/100d6f78011f0a773442411e2882a0203d390585/src/image.c#L193
  2. And this line: https://github.com/AlexeyAB/darknet/blob/100d6f78011f0a773442411e2882a0203d390585/src/image.c#L251

  3. to this if (prob > thresh && class_id == 14) { if you use yolo-voc.weights (14 is number of line in the file voc.names where is person)

  4. or to this if (prob > thresh && class_id == 0) { if you use yolo.weights (0 is number of line in the file coco.names where is person)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/AlexeyAB/darknet/issues/433#issuecomment-371459838, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AffFLB0a_8uEu9frkU2ZMTQVJAQhoP6Bks5tcRTIgaJpZM4SiFzY.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bit-scientist picture bit-scientist  Â·  3Comments

Jacky3213 picture Jacky3213  Â·  3Comments

off99555 picture off99555  Â·  3Comments

louisondumont picture louisondumont  Â·  3Comments

Greta-A picture Greta-A  Â·  3Comments