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

deep-organizer

v1.0.3

Published

Media organizer with Object detection model (coco-ssd) in TensorFlow.js

Downloads

5

Readme

deep media organizer with deep leraning (mobilenet-ssd)

This is a nodejs package to organize files like images and videos in folders with respective classes detected by a Tensorflow object detect model (converted from python to js).

Usage

const DeepOrganizer = require('@nindoo/deep-organizer').DeepOrganizer

const modelConfig = {
    modelUrl: 'file://path/for/your/web_model/model.json',
    classes: {
        1: {
            name: 'CNH_F',
            id: 1,
            displayName: 'CNH_F'
        },
        2:{
            name: 'CNH_Fv',
            id: 2,
            displayName: 'CNH_Fv'
        }
    }
}

const mediaPath = 'media/path/videos-or-images'
const organizer = new DeepOrganizer(modelConfig, mediaPath)
organizer.loadModel().then(async ()=>{
    await organizer.organizeImagesTo(mediaPath)
    await organizer.organizeVideosTo(mediaPath)
})

modelConfig

const modelConfig = {
    modelUrl: 'It MUST start with file:// for local files or https:// for remote files',
    classes: 'It repesent your label_map.pbtxt from your tensorflow model'
}

Technical details for advanced users

This model is based on the TensorFlow object detection API. You can download the original models from here. We applied the following optimizations to improve the performance for browser execution:

  1. Install the TensorFlow.js pip package:

pip install tensorflowjs

  1. Run the converter script provided by the pip package:

The converter expects a TensorFlow SavedModel, TensorFlow Hub module, TensorFlow.js JSON format, Keras HDF5 model, or tf.keras SavedModel for input.

TensorFlow SavedModel example:

tensorflowjs_converter \
    --input_format=tf_saved_model \
    --output_format=tfjs_graph_model \
    --signature_name=serving_default \
    --saved_model_tags=serve \
    /mobilenet/saved_model \
    /mobilenet/web_model 

Tensorflow Hub module example:

tensorflowjs_converter \
    --input_format=tf_hub \
    'https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/classification/1' \
    /mobilenet/web_model 

Keras HDF5 model example:

tensorflowjs_converter \
    --input_format=keras \
    /tmp/my_keras_model.h5 \
    /tmp/my_tfjs_model

tf.keras SavedModel example:

tensorflowjs_converter \
    --input_format=keras_saved_model \
    /tmp/my_tf_keras_saved_model/1542211770 \
    /tmp/my_tfjs_model

more information about convertion here