Giter VIP home page Giter VIP logo

Comments (6)

dmandrioli avatar dmandrioli commented on May 30, 2024

No it's not possible for now. Let's create a feature request.

from semantic-segmentation-editor.

brappazzo avatar brappazzo commented on May 30, 2024

Has anyone worked on this?

from semantic-segmentation-editor.

dmandrioli avatar dmandrioli commented on May 30, 2024

Hello @brappazzo, nothing new on this feature, feel free to provide a PR.
Thanks.

from semantic-segmentation-editor.

brappazzo avatar brappazzo commented on May 30, 2024

I am trying to work on this, any suggestions on the best approach?

from semantic-segmentation-editor.

dmandrioli avatar dmandrioli commented on May 30, 2024

First draw some polygons then look at the content of the mongo database, the goal is to inject data with the same format.
Then you will need a server-side service to inject the JSON into mongo, you can take inspiration from server/files.js or server/api.js. The transfered data could be a regular file or directly the JSON content.

I hope this helps, I will be happy to review your pull request if you plan to submit one.

from semantic-segmentation-editor.

DuinoDu avatar DuinoDu commented on May 30, 2024

You can inject json into mongo using below code:

from pymongo import MongoClient


class SseHelper:

    def __init__(self):
    ¦   client = MongoClient('127.0.0.1:3001')
    ¦   db = client.meteor
    ¦   self.SseSamples = db.SseSamples

    def get_anno(self, filename: str):
    ¦   url = "/" + filename.replace("/", "%2F")
    ¦   anno = self.SseSamples.find_one({"url": url})
    ¦   return anno

    def set_anno(self, filename: str, anno: dict):
    ¦   url = "/" + filename.replace("/", "%2F")
    ¦   self.SseSamples.update_one({"url": url}, {"$set": anno})

    def add_anno(self, anno: dict):
    ¦   ret = self.SseSamples.insert_one(anno)


if __name__ == "__main__":
    sse = SseHelper()
    query = "/test/1.png"
    anno = sse.get_anno(query)
    # load your anno from json file
    anno["objects"].pop(0)
    sse.set_anno("/test/1.png", anno)
    # sse.add_anno(new_anno)

from semantic-segmentation-editor.

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.