Skip to content

paulsp94/tfjs_resnet_imagenet

Repository files navigation

ResNet Model trained on ImageNet

GSOC GitHub npm (tag)

The ResNet50 model pretrained on imagenet for TensorFlow.js as a layers model.
On ImageNet, this model gets to a top-1 validation accuracy of 0.749 and a top-5 validation accuracy of 0.921.
The default input size for this model is 224x224.

This model has been converted, using the tfjs-converter.
The base model and weights were taken from keras.

Install npm install resnet_imagenet

How to use

import ResNetPredictor from 'resnet_imagenet';

const tabbyCatURI = 'https://upload.wikimedia.org/wikipedia/commons/6/66/An_up-close_picture_of_a_curious_male_domestic_shorthair_tabby_cat.jpg';

const run = async () => {
    const predictor = await ResNetPredictor.create();
    const prediction = await predictor.classify(tabbyCatURI);
    return prediction;
}

To try the model you can just load it using:

ResNetURL = 'https://raw.githubusercontent.com/paulsp94/tfjs_resnet_imagenet/master/ResNet50/model.json';
const ResNet = await tf.loadLayersModel(ResNetURL);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published