Code Monkey home page Code Monkey logo

Comments (5)

jsbroks avatar jsbroks commented on September 6, 2024 2

@saurabheights looks good ill accept a pr

from imantics.

amplejoe avatar amplejoe commented on September 6, 2024 1

@saurabheights thanks a lot, that's great!

from imantics.

saurabheights avatar saurabheights commented on September 6, 2024

The method def index(self, image) looks for annotation in dataset annotations and tries to update its id until annotation_index has no annotation with same id. Problem is that this has been implemented in recursive manner. Since I never set annotation id as I did for images in #24 , as more annotations gets indexed, the recursive update of id keeps going deeper and deeper.

from imantics.

amplejoe avatar amplejoe commented on September 6, 2024

I've now as well hit this same error, which happens when the underlying dataset exceeds a certain size. This is indeed a critical issue, since without fixing the dataset indexing the library is unusable right now.

from imantics.

saurabheights avatar saurabheights commented on September 6, 2024

@amplejoe This below is quick fix. Hope it helps. Just incrementing it should be fine. I can make a PR, if @jsbroks is fine with it.

The quick fix basically sets id to max index_id +1. My first change was to just increment till no such id is found, but it gets pretty slow.

    def index(self, image):

        annotation_index = image.annotations
        category_index = image.categories

        if self.id < 1:
            self.id = len(annotation_index) + 1

        # Increment index until not found
        if annotation_index.get(self.id):
            self.id = max(annotation_index.keys()) + 1

        annotation_index[self.id] = self

        # Category indexing should be case insenstive
        category_name = self.category.name.lower()

        # Check if category exists
        category_found = category_index.get(category_name)
        if category_found:
            # Update category
            self.category = category_found
        else:
            # Index category
            category_index[category_name] = self.category

from imantics.

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.