Giter VIP home page Giter VIP logo

Comments (6)

hellochick avatar hellochick commented on July 28, 2024

Hi @ifangcheng,
Sorry for misleading you. In cityscapes dataset I directly ignore the background ( pixel value is 255 ), so the num_classes is 19 ( from 0 to 18 ). Hence, the class number shouldn't include the background, since we can set the ignore label to ignore it, that is, we ignore every pixel that has value of 255. You can take a look at get_mask function ( line 96-102 in train.py ).

from icnet-tensorflow.

ifangcheng avatar ifangcheng commented on July 28, 2024

@hellochick thanks! got it!

from icnet-tensorflow.

Tamme avatar Tamme commented on July 28, 2024

Is it really the same for ade20k and the like datasets where 0 is the void label? It seems to me that if labels are eg [0: void, 1:road, 2:grass, 3:forest, 4:sky], I need to set NUM_CLASSES=5 and just ignore when it predicts 0. at least this is the only way I get same evaluation mIoU when switching void from 255 to 0.

from icnet-tensorflow.

hellochick avatar hellochick commented on July 28, 2024

@Tamme, when I evaluate for ade20k, I subtract the labels by 1, and ignore label -1. You can try this. Since the classes we predict is from 0-149 and the label is from 0-150 where 0 means background.

from icnet-tensorflow.

Tamme avatar Tamme commented on July 28, 2024

@hellochick thats what I thought was sensible, but this at ~ line 140 in evaluate.py seems contradicting:

if args.dataset == 'ade20k':
pred = tf.add(pred, tf.constant(1, dtype=tf.int64))
mIoU, update_op = tf.contrib.metrics.streaming_mean_iou(pred, gt, num_classes=param['num_classes']+1)
elif args.dataset == 'cityscapes':
mIoU, update_op = tf.contrib.metrics.streaming_mean_iou(pred, gt, num_classes=param['num_classes'])

Or is it the wrong place I'm looking at :)

from icnet-tensorflow.

hellochick avatar hellochick commented on July 28, 2024

@Tamme Oh, it will lead to the same result. In this code, I add our predictions by 1, so as to shift our prediction from [0-149] to [1-150]. And then ignore the class 0 in ground truth which means background. Is this make sense to you?

from icnet-tensorflow.

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.