1.0.4 • Published 1 year ago

plant_inference v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Hello from Da Nang plantID

Author: TuongNH

Example

// Import library
const PlantInference = require("plant_inference")

// Config model
const model = new PlantInference(
    "path/to/model.onnx",
    "path/to/database.json"    
);
// Load model
// Note: It take few minutes and memory
await model.init();

// Inference on image
// Save this image to test https://trungtamduoclieu.vn/files/sanpham/249/1/jpg/co-seo-ga.jpg
const result = await model.inference("path/to/image/jpg");
console.log(result);

Result

[
  {
    id: '70760',
    rate: 0.42857142857142855,
    name: 'Ráng Chân xỉ sọc'
  },
  {
    id: '70752',
    rate: 0.2857142857142857,
    name: 'Ráng seo gà hình gươm'
  },
  {
    id: '70731',
    rate: 0.14285714285714285,
    name: 'Ráng cổ lý ngón'
  },
  {
    id: '70756',
    rate: 0.14285714285714285,
    name: 'Ráng chân xỉ lược'
  }
]

Note:

  • Contact the author to get weight and database (huytuong010101@gmail.com)
  • Be careful because the code can take large memory