Comments (9)
Hi Andrew,
Can you change in main.py
if args.cuda:
criterion = CrossEntropyLoss2d(weight.cuda())
else:
criterion = CrossEntropyLoss2d(weight)
to
criterion = CrossEntropyLoss2d()
also you might want to read this for binary segmentation.
from piwise.
Thank you @bodokaiser !
from piwise.
Hi @bodokaiser again,
Just a small question, why the number of class is defined as 22 if PascalVoc has 20 classes?
from piwise.
I think VOC before 2012 had less classes, however according to segmentation examples
pixel indices correspond to classes in alphabetical order (1=aeroplane, 2=bicycle, 3=bird, 4=boat, 5=bottle, 6=bus, 7=car , 8=cat, 9=chair, 10=cow, 11=diningtable, 12=dog, 13=horse, 14=motorbike, 15=person, 16=potted plant, 17=sheep, 18=sofa, 19=train, 20=tv/monitor)
For both types of segmentation image, index 0 corresponds to background and index 255 corresponds to 'void' or unlabelled.
from piwise.
Thank you @bodokaiser !
So, if I have only 2 classes on my dataset (0 = background, 255 = foreground), I need to set NUM_CLASSES = 2 ?
from piwise.
NUM_CLASSES = 2
basically just says how much output channels to use in the last layer(s) of the chosen network architecture.
There is also another VOC specific transform which convert the color codes of the VOC images to class labels numbered from 1 to 22 so you might want to change this according to your dataset.
from piwise.
Solved!
from piwise.
I am trying to solve a binary mask segmentation as well for my dataset in this VOC format.. however getting a NaN value for segmentation loss.. could you please help me here??
Thanks!
from piwise.
Hello @numancelik34 ,
I am sorry for the late reply, and thank you for the contact!
Yes, my solution for this issue can be found here:
https://github.com/andrewssobral/deep-learning-pytorch/tree/master/segmentation
I created a git repository with some codes showing how to do binary segmentation with pytorch.
Please, let me know if it helps you, and feel free to contact me if you have any questions.
Best regards,
Andrews
from piwise.
Related Issues (20)
- SyntaxError: invalid syntax in main.py HOT 2
- Object detection HOT 9
- Syntax Error in main.py HOT 2
- No model named segnet2? HOT 4
- Evaluation error HOT 4
- Out of Memory Issue HOT 2
- No folder named "Labels", Tuple Index out of range, size mismatch. HOT 6
- Is there some question in transform.py? HOT 4
- The result of the semantic segmentation HOT 1
- A question about the size of output imgae HOT 1
- This question is about how to eliminate the white box in the image HOT 1
- Some questions about dataset HOT 4
- About an inexplicable bug HOT 1
- It's different with the standard SegNet HOT 9
- Does the relization of the Segnet in network.py match the paper of segnet? HOT 2
- 用自己的数据集后得到的预测结果全红 HOT 1
- Softmax in the evaluation stage HOT 1
- Blank output maps! HOT 9
- Pretrained models HOT 23
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 piwise.