-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CamVid dataset for segmentation #90
base: main
Are you sure you want to change the base?
Conversation
torchvision/datasets/camvid.py
Outdated
return images | ||
|
||
|
||
def LabelToLongTensor(pic): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
So, I'm not sure about the Joint Transforms. We were thinking about factoring out the random number generation from the transforms, so that the same random transform can be applied to different inputs (and eventually to inputs from different modalities, such as images and bounding boxes). |
OK. I'll modify the code based on the new version of transforms. |
Hi @fmassa, Also, I made the function private. However, the other two class should be public. They should be able to be used by the users. |
Hi @felixgwu, In a local branch I factored out the random parameter generation from the transforms, and I'm using it now in a project for semantic segmentation. The drawback of this approach is that we need to pass an extra argument to the constructor of the dataset (let's call it This requires passing a new argument to the constructor, but I think it's better than having joint transforms, because we light want to apply some individual transforms before / after the joint transforms, which would not be possible in this setup. I'm not yet 100% hapoy with my refactoring, but it's time to send a PR to get some feedback. I'm out of my computer this weekend, but when I create the PR I'll tag you on it. |
Did it succeed? |
Hello @felixgwu and sorry for taking that long to get back at you. As you might know, there is a new dataset API being designed and existing datasets will be ported to it. Here is a thread explaining the logic behind it: #5336. Also, there is this thread that discusses adding the CamVid dataset: #60. You are probably aware of it. As far as my understanding goes, it would be better to wait a bit until the new design is stable. Then, it would be best to port the code here to the new design. Someone can help you doing it of course and proper attribution will be given to you @felixgwu of course or you can do it yourself if you want to. What do you think @felixgwu? Also, since this PR is a bit old maybe you don't need it anymore and/or found an alternative. Any feedback is welcome @felixgwu. Thanks again and sorry for the long delay. |
@yassineAlouini This PR adds two things:
The second part is well covered by the transforms rework that is currently going on. If I'm not mistaken we already have transformations for everything proposed here in As for the dataset, the implementation seems pretty straight forward. Porting it to the new API should be simple. As of now, we haven't we looked mostly into classification and detection datasets, but segmentation datasets will follow soon. We should wait at least until then before we have a go at this. |
Because of the request #60, I implemented this Camvid dataset class for people who are interested in doing image segmentation.
Since both the input and target should go through the same transformation, I added the file join_transform.py which allows us to do the same image transformation on a list of images.
Sample usage:
Currently, the download function is not implemented yet.
It requires the users to download the data from here by themselves.