npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-image-analyzer

v1.0.0

Published

`ai-image-analyzer` is a powerful Node.js library that leverages TensorFlow.js to classify images and detect objects using pre-trained models like MobileNet and COCO-SSD. It supports input as either a file path or an image buffer for enhanced flexibility.

Readme

ai-image-analyzer

ai-image-analyzer is a powerful Node.js library that leverages TensorFlow.js to classify images and detect objects using pre-trained models like MobileNet and COCO-SSD. It supports input as either a file path or an image buffer for enhanced flexibility.

Features

  • Image Classification: Classify images using the MobileNet model.
  • Object Detection: Detect objects in images using the COCO-SSD model.
  • Flexible Input: Accepts file paths or raw image buffers as input.

❤️ Support My Work!

Maintaining this package requires effort and dedication. If this project helped you, consider buying me a coffee or supporting me via PayPal. Every donation helps keep this project alive!

Support via PayPal

Installation

npm install ai-image-analyzer

Usage

Import the Library

import { classifyImage, detectObjects } from 'ai-image-analyzer';

Image Classification

const predictions = await classifyImage('/path/to/image.jpg');
// OR
import { readFileSync } from 'fs';
const imageBuffer = readFileSync('/path/to/image.jpg');
const predictions = await classifyImage(imageBuffer);

console.log('Predictions:', predictions);

Object Detection

const detections = await detectObjects('/path/to/image.jpg');
// OR
const imageBuffer = readFileSync('/path/to/image.jpg');
const detections = await detectObjects(imageBuffer);

console.log('Detections:', detections);

Output Format

Image Classification The classifyImage function returns an array of predictions:

[
  {
    "className": "object name",
    "probability": 0.95
  },
  {
    "className": "another object name",
    "probability": 0.85
  }
]

Object Detection The detectObjects function returns an array of detections:

[
  {
    "bbox": [x, y, width, height],
    "class": "object name",
    "score": 0.9
  },
  {
    "bbox": [x, y, width, height],
    "class": "another object name",
    "score": 0.8
  }
]

Requirements

  • Node.js 16 or later
  • TensorFlow.js dependencies (@tensorflow/tfjs-node, @tensorflow-models/mobilenet, @tensorflow-models/coco-ssd)

API Reference

classifyImage(imageInput: string | Buffer): Promise<any[]>

Classifies the input image and returns an array of predictions.

  • imageInput: Path to the image file or an image buffer.
  • Returns: Array of predictions with class names and probabilities.
detectObjects(imageInput: string | Buffer): Promise<any[]>

Detects objects in the input image and returns an array of detections.

  • imageInput: Path to the image file or an image buffer.
  • Returns: Array of detections with bounding boxes, class names, and scores.

License

This project is licensed under the MIT License. See the LICENSE file for details.