Git Product home page Git Product logo

Comments (15)

anandcu3 avatar anandcu3 commented on July 17, 2024 1

@kyamagu Thank you very much. It worked. :)

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 Do you change the set of labels? The crash happens because the annotation data seem to contain a label index outside of the given set.

https://github.com/kyamagu/js-segment-annotator/blob/master/js/app/edit.js#L476

from js-segment-annotator.

anandcu3 avatar anandcu3 commented on July 17, 2024

@kyamagu I did not change the labels but the annotation image was generated by a inaccurate ML algorithm . But I made sure the value in the annotations are between 0 and n (num of classes). 1->Sky, 2->Building etc..

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 You have to have 0 index (usually background) in the label set.

from js-segment-annotator.

anandcu3 avatar anandcu3 commented on July 17, 2024

@kyamagu Isn't that Sky in my case ?

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 You are mapping Sky to 1, not 0.

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

If you really intend to use Sky for 0, then I assume there is invalid integer index in the incomplete data.

from js-segment-annotator.

anandcu3 avatar anandcu3 commented on July 17, 2024

@kyamagu I'm sorry I made a mistake in my earlier message. I have mapped sky-->0, building->1 and so on.. So background is sky which has value 0 in the image.

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 Ok, then first check unique set of index values in the annotation PNG.

from js-segment-annotator.

anandcu3 avatar anandcu3 commented on July 17, 2024

The other question is are there any specifications to the annotations image format that has to be taken care of ..

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 The format is specified in README.

from js-segment-annotator.

anandcu3 avatar anandcu3 commented on July 17, 2024

@kyamagu

a=cv2.imread("data/annotations/00001.png")
print(numpy.unique(a))

returned

array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=uint8)

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 The PNG is RGB-encoded UINT32 and cannot be read just by cv2.imread. Make sure all the index values are properly formatted. Other than that, you can always open up browser javascript console to inspect values.

from js-segment-annotator.

anandcu3 avatar anandcu3 commented on July 17, 2024

@kyamagu I've an array with the same shape of an image. Each pixel representing the class label. How do I encode this? I've been trying to use the encode portion of the code in README but I get this error.

Traceback (most recent call last): File "D:\anand\anaconda3\lib\site-packages\PIL\Image.py", line 2167, in fromarray mode, rawmode = _fromarray_typemap[typekey] KeyError: ((1, 1, 3, 3), '|u1')

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\anand\anaconda3\lib\site-packages\PIL\Image.py", line 2170, in fromarray raise TypeError("Cannot handle this data type") TypeError: Cannot handle this data type

from js-segment-annotator.

kyamagu avatar kyamagu commented on July 17, 2024

@anandcu3 Convert the array to uint32 first, then try encoding with the code example.

from js-segment-annotator.

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.