Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

91
Views
Library To Detect Specific Object

I've been searching on google for the last few days and interesingly got a library to detect object using JavaScript. Here's the link:

GitHub Project

It's called ml5.js and it's built on top of TensorFlow. It uses machine learning algorithm that I am trying to get familiar. I tried to use one of their library from here:

Sample Project

Then type ObjectDetector_COCOSSD_single_image and requires to download it from here. I already downloaded it and run it using local server with VS Code. This code snippet though helped me a lot:

let objectDetector;

let img;
let objects = [];
let status;

function preload(){
  img = loadImage('images/cat.jpg');
}


function setup() {
  createCanvas(640, 420);

  objectDetector = ml5.objectDetector('cocossd', modelReady);

}

//Change the status when the model loads.
function modelReady() {
  console.log("model Ready!")
  status = true;
  console.log('Detecting') 
  objectDetector.detect(img, gotResult);
}

//A function to run when we get any errors and the results
function gotResult(err, results) {
  if (err) {
    console.log(err);
  }
  console.log(results)
  objects = results;
}


function draw() {
  //Unless the model is loaded, do not draw anything to canvas
  if (status != undefined) {
    image(img, 0, 0)

    for (let i = 0; i < objects.length; i++) {
      noStroke();
      fill(0, 255, 0);
      text(objects[i].label + " " + nfc(objects[i].confidence * 100.0, 2) + "%", objects[i].x + 5, objects[i].y + 15);
      noFill();
      strokeWeight(4);
      stroke(0, 255, 0);
      rect(objects[i].x, objects[i].y, objects[i].width, objects[i].height);
    }
  }
}

In the console log of the browser, I checked, it sent a request to this api - Model in jSon

It's a jSon file and the model to train, I believe. Though it's unable to detect all object properly like it detects turtle as bird, receipt as book. For the being, is there any model that I can make use of to this library or make it more accurate to detect object?

N.B: My plan is to detect paper specifically receipt from POS, I am not sure if I can modify the above code to make it work as expected though trying to figure out. Anyone has idea or worked on the library could share their opinion, so I can go ahead with it.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!