Git Product home page Git Product logo

Comments (2)

Minotaur-CN avatar Minotaur-CN commented on August 15, 2024 1

Yes, Thanks for your quick response!

I saw normal CVDataset processing class, which using 255 as the portrait label.
which label should be used for training?

Regards!


class CVDataset(torch.utils.data.Dataset):
....
def getitem(self, idx):
image_name = self.imList[idx]
label_name = self.labelList[idx]
image = cv2.imread(image_name)
label = cv2.imread(label_name, 0)
label_bool = 255 * ((label > 200).astype(np.uint8))


class ToTensor(object):
...
image_tensor = torch.from_numpy(image).div(255)
label_tensor = torch.LongTensor(np.array(label, dtype=np.int)).div(255) #torch.from_numpy(label)

from ext_portrait_segmentation.

HYOJINPARK avatar HYOJINPARK commented on August 15, 2024

Hello @Minotaur-CN Thanks for your asking
0 is a background 1 is a foreground.
Most of the segmentation dataset denotes 255 for not labeled pixel (It means hard to classify into any class)or ignoring in training.
Therefore, I just follow this custom by my habit.
However, that does not need in here, cuz the dataset is 0 or 255 and 255 convert to 1

from ext_portrait_segmentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.