Giter VIP home page Giter VIP logo

Comments (17)

khdlr avatar khdlr commented on July 20, 2024

Yes, you got that right.

The img and target parameters to the full_forward method used during training are exactly the original image (img) and the binary target segmentation (target).

Cheers, Konrad

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

Thanks for answering! Where are the original pictures and binary pictures in the code?

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

You can download the INRIA data here: https://project.inria.fr/aerialimagelabeling/

Here's the code that reads in the dataset: https://github.com/khdlr/HED-UNet/blob/master/deep_learning/utils/data.py

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

Thanks Reply! What pictures are put in the AerialImageDataset and scenes texts in the code?

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

The AerialImageDataset is the only folder that is being used. scenes is not used anymore, I will update the code and delete the get_batch function. Thanks for catching my error!

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

Can you show me how you created the data file? I want to train my own data set.

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

The dataset was not created by me, I just wrote the code that loads the data at training time.

What you need to do to train on your own data, is to implement a torch.utils.data.Dataset that returns pairs of image and ground truth annotations.

Then you can change the get_dataset function in data_loading.py to use your custom dataset instead of the pre-configured InriaDataset.

Let me know if that helps!

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

I have 256*256 original images and binary images of aerial cities here, but I don’t know how to train this net

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

Okay, so you'll subclass torch.utils.data.Datset like this

class MyCustomDataset(torch.utils.data.Dataset):
  def __init__(self):
    # Do whatever initialization you need:
    self.images  = <list_of_image_paths>
    self.targets = <list_of_binary_annotations>

  def __getitem__(self, index):
    # "load_image" can be imageio.imread for example
    image  = load_image(self.images[index])
    target = load_image(self.targets[index])
    return image, target
  
  def __len__(self):
    return len(self.images)

Then you can simply change data_loading.py to use MyCustomDataset instead of InriaDataset.

Hope that helps.

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

Thank you

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

That is odd. I used fairly large pictures for training (768x768), but 256x256 should work.

Can you confirm that your masks are valid? What is the output if you add print(torch.unique(target)) to the full_forward function in train.py?

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

Not entirely sure what you mean by original / two-difference diagrams.

Another issue might be data scaling - what is the output when you add print('img', torch.min(img), torch.mean(img), torch.max(img)) in full_forward?

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

BinitPandit94 avatar BinitPandit94 commented on July 20, 2024

As input, you have given the images and their segmented mask. I want to know what ground truth you have considered while modeling the edge detection part. It seems Sobel Kernel has been used for edge calculation (but in the paper, it has been written that your results are compared with those). Please highlight the Edge Detection part. Thank You.

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

At training time, we compute the edge GT by applying Sobel to the segmentation GT for cases where no edge GT is available. As these segmentation masks are valued in {0,1}, we can recover perfect edge masks.

The "Sobel" comparison in the paper is referring to applying Sobel directly to the imagery at test time, which will generate much worse edge masks.

from hed-unet.

Related Issues (18)

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.