Code Monkey home page Code Monkey logo

Comments (4)

kyamagu avatar kyamagu commented on May 30, 2024 1

@tofighi Check the add_entry() method.
https://github.com/kyamagu/bbox-annotator/blob/master/bbox_annotator.coffee#L228

editor.add_entry({
    "top": 0,
    "left": 0,
    "width": 100,
    "height": 100,
    "label", "object"
})

from bbox-annotator.

kyamagu avatar kyamagu commented on May 30, 2024 1

@tofighi You need to clear all first then add a desired one.

  // Initialize the reset button.
  $("#reset_button").click(function(e) {
    annotator.clear_all();
    annotator.add_entry({
      "top": 10,
      "left": 10,
      "width": 100,
      "height": 100,
      "label": "object"
    });
  });
  // Force initialization here by clicking the reset once at the beginning.
  $("#reset_button").click();

from bbox-annotator.

tofighi avatar tofighi commented on May 30, 2024

Thanks but it does not work for me, probably because I am not using the right way to call the function. Let's say I am going to change the behavior of the reset button in your demo example as follows:

  // Initialize the reset button.
  $("#reset_button").click(function(e) {
    annotator.clear_all();
  })

I would like to click on the reset button and the following label is desired to be added to the figure:

{
    "top": 0,
    "left": 0,
    "width": 100,
    "height": 100,
    "label", "object"
}

The following solution will not work, could you please help?

  // Initialize the reset button.
  $("#reset_button").click(function(e) {
    annotator.add_entry({
    "top": 0,
    "left": 0,
    "width": 100,
    "height": 100,
    "label", "object"
     })
  })

from bbox-annotator.

tofighi avatar tofighi commented on May 30, 2024

@kyamagu Worked perfectly.

from bbox-annotator.

Related Issues (15)

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.