1

So I have labeled the entire skeletal muscles in detail. For example instead of just labeling shoulders I have labeled:

  • Rear Delt
  • Middle Delt
  • Front Delt

but now you want all of the delts to be combined as one object, shoulder. Is there anyway to take all of the previous labeled images of laptops and combine them as one object?

The why: We have a lot of objects that are close to one another and it's making the model pretty big and complex. I want to drastically reduce the number of objects in the model but I don't want to lose over 15,000 labeled instance segmentation images.

thank you in advance

AdvilPLZ
  • 11
  • 1

1 Answers1

0

There are probably many ways to combine classes. Here is my suggestion:

  1. Figure out the mask pixel values for each of the classes you want to pool (e.g. Rear Delt = 1, Middle Delt = 2, front delt = 3)
  2. Next choose a "recode" pixel value of the pooled class that is not used for any other class (e.g., make all of them 1).
  3. Loop through each mask file to (re)assign the "recode" value to a pixel if the pixel value is equal to the value determined in #1 above.

As an aside, you should confirm that your recoding worked by visualizing the masks before and after the recode.

Also, don't save the new mask file over your original mask file. You never know when you may need the original again.

Finally, there is a SO post on vectorizing this process.

Snehal Patel
  • 912
  • 1
  • 1
  • 25