Coder Social home page Coder Social logo

Comments (4)

varunjampani avatar varunjampani commented on June 15, 2024

For training SSN with BSDS, we convert GT segmentation into one-hot encoding and we assume that there are maximum 50 segments in an image. See 'convert_label' function (lines 59-74) in fetch_and_transform_data.py. You would need to modify this function if you want to train with existing superpixels as GT. You may face memory issues if this one-hot encoding matrix is big.

from ssn_superpixels.

ShaneZHOU1994 avatar ShaneZHOU1994 commented on June 15, 2024

Hello,
I still meet this problem. Here is the detail:
I notice that the structure of segmentation data in BSDS500 is rather complicated (those .mat files), which contain lots of information but not useful to my study; as my concern, the only important info is the matrix of marked labels (481x321 size, with integers marking each pixel to its segmented region). So my data (also .mat files) just contain this matrix.
In order to input my ground truth correctly, here is how I modify the code:

  1. in function “fetch_and_transform_data” and “fetch_and_transform_patch_data”, I comment these two lines
    # t = np.random.randint(0, len(gtseg_all['groundTruth'][0]))
    # gtseg = gtseg_all['groundTruth'][0][t][0][0][0]
    and write mine:gtseg = gtseg_all['groundTruth'] to match my data structure;
  2. also, I followed your instruction to change the max number of segments from 50 to 120, (actually this number 50 appears in five places in whole program and they seem to refer to the same thing as this max number);
  3. the result is that I get stuck when it create input layer, with no error message, just stay stuck and still, after showing this line:
    Outputs: [‘img’, ‘spixel_init’, ‘feat_spixel_init’, ‘label’, ‘problabel’]

now I’m thinking this problem might come from the structure of GT data, because the only thing I changed is the replacement of GT data. So could you tell me what you think about my problem and explain a bit more about how you treat the structure of GT data (‘from .mat file’) , especially the label matrix? Did I miss some very important things for the processing of GT data?

Thanks

from ssn_superpixels.

varunjampani avatar varunjampani commented on June 15, 2024

Your understanding of gt segmentations is correct. I just read label integers from mat files and convert them into one-hot encodings. It is difficult to debug without error message. You may need to debug this manually with 'pdb' stop statements 'pdb.set_trace()'.

from ssn_superpixels.

ShaneZHOU1994 avatar ShaneZHOU1994 commented on June 15, 2024

Thanks for your advice, my problem is now solved (after long time of debugging and adjusting parameters in the code, finally...)

from ssn_superpixels.

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.