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 🙏

© 2024 – Pkg Stats / Ryan Hefner

legacy-kittydar

v0.2.1

Published

Cat detection

Downloads

3

Readme

Kittydar

Kittydar is short for kitty radar. Kittydar takes an image (canvas) and tells you the locations of all the cats in the image:

var cats = kittydar.detectCats(canvas);

console.log("there are", cats.length, "cats in this photo");

console.log(cats[0]);

// { x: 30, y: 200, width: 140, height: 140 }

Kittydar demo

Install

For node:

npm install kittydar

Or grab the browser file

Specifics

Kittydar takes a canvas element. In node you can get a Canvas object with node-canvas.

Kittydar will give an approximate rectangle around the cat's head. Each rectangle has an x and y for the top left corner, and a width and height of the rectangle.

How it works

Kittydar first chops the image up into many "windows" to test for the presence of a cat head. For each window, kittydar first extracts more tractable data from the image's data. Namely, it computes the Histogram of Orient Gradients descriptor of the image, using the hog-descriptor library. This data describes the directions of the edges in the image (where the image changes from light to dark and vice versa) and what strength they are. This data is a vector of numbers that is then fed into a neural network which gives a number from 0 to 1 on how likely the histogram data represents a cat.

The neural network (the JSON of which is located in this repo) has been pre-trained with thousands of photos of cat heads and their histograms, as well as thousands of non-cats. See the repo for the node training scripts.

Limitations

Kittydar will miss cats sometimes, and sometimes classify non-cats as cats. It's best at detecting upright cats that are facing forward, but it can handle a small tilt or turn in the head.

Kittydar isn't fast. It'll take a few seconds to find the cats in one image.

There's lots of room for improvement, so fork and send requests.

Propers