Comments (17)
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.
Thanks for answering! Where are the original pictures and binary pictures in the code?
from hed-unet.
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.
Thanks Reply! What pictures are put in the AerialImageDataset and scenes texts in the code?
from hed-unet.
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.
Can you show me how you created the data file? I want to train my own data set.
from hed-unet.
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.
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.
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.
Thank you
from hed-unet.
from hed-unet.
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.
from hed-unet.
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.
from hed-unet.
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.
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)
- How could I get the complete images on result HOT 1
- Training steps HOT 4
- Testing data HOT 7
- Whether this program can handle .png files. If you can’t handle it, can you convert the .tif file to a .png file? HOT 1
- AttributeError: 'Array' object has no attribute 'numpy' HOT 1
- RuntimeError: Given groups=1, weight of size [16, 3, 1, 1], expected input[8, 4, 256, 256] to have 3 channels, but got 4 channels instead HOT 10
- Hello, my training is successful, then I would like to ask how to test my own data? HOT 1
- About training HOT 21
- About Loss HOT 5
- About mutil classes HOT 19
- Hed HOT 7
- Weight Map HOT 2
- I have some questions about testing. HOT 6
- About the differences between predictions and queries. HOT 3
- Does the edge detection task have an impact on the semantic segmentation task in this model? HOT 1
- Can you please share the pre-trained weights for interence HOT 1
- Can the author provide code for prediction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hed-unet.