tfjs-models | Pretrained models for TensorFlow.js | Machine Learning library

 by   tensorflow TypeScript Version: tasks-v0.0.1-alpha.6 License: Apache-2.0

kandi X-RAY | tfjs-models Summary

kandi X-RAY | tfjs-models Summary

tfjs-models is a TypeScript library typically used in Artificial Intelligence, Machine Learning, Tensorflow applications. tfjs-models has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This repository hosts a set of pre-trained models that have been ported to TensorFlow.js. The models are hosted on NPM and unpkg so they can be used in any project out of the box. They can be used directly or used in a transfer learning setting with TensorFlow.js. To find out about APIs for models, look at the README in each of the respective directories. In general, we try to hide tensors so the API can be used by non-machine learning experts. For those interested in contributing a model, please file a GitHub issue on tfjs to gauge interest. We are trying to add models that complement the existing set of models and can be used as building blocks in other apps.

            kandi-support Support

              tfjs-models has a medium active ecosystem.
              It has 12912 star(s) with 4133 fork(s). There are 272 watchers for this library.
              It had no major release in the last 12 months.
              tfjs-models has no issues reported. There are 87 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of tfjs-models is tasks-v0.0.1-alpha.6

            kandi-Quality Quality

              tfjs-models has 0 bugs and 0 code smells.

            kandi-Security Security

              tfjs-models has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              tfjs-models code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              tfjs-models is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              tfjs-models releases are available to install and integrate.
              It has 1414 lines of code, 0 functions and 356 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tfjs-models
            Get all kandi verified functions for this library.

            tfjs-models Key Features

            No Key Features are available at this moment for tfjs-models.

            tfjs-models Examples and Code Snippets

            No Code Snippets are available at this moment for tfjs-models.

            Community Discussions


            How to remove background from webcam input in browser without greenscreen?
            Asked 2021-Aug-12 at 06:10

            There are ways to remove background from webcam input in browser itself using tensorflow.js and body-pix model. Lot of example codes are given in internet using these but these examples does not work well and results are very laggy and not accurate enough to use for production.



            Answered 2021-Aug-12 at 06:10


            React Native with TypeScript tfjs-models/universal-sentence-encoder error on model load
            Asked 2021-May-13 at 14:12

            I'm trying to use tfjs-models/universal-sentence-encoder within a React Native app by following these instructions. However, I get the following error when I try to load the model:



            Answered 2021-May-13 at 05:13

            I think it is to do with the way you are importing the universal-sentence-encoder, try this instead:



            How to get specific landmark of face like lips or eyes using tensorflow.js face-landmark-detection model
            Asked 2021-Mar-16 at 09:31

            I am trying to change the shape and position of eyes and lips and for this purpose I use tenserflow.js face-landmark-detection model. I get the all 468 facial landmarks but the problem is i don't know and i never find any solution on internet how to get the position of only required landmark like lips and eyes. I get all the points but want to apply changes on lips and eyes how i apply changes only on these landmarks.



            Answered 2021-Mar-16 at 05:47

            The coordinates of are available here.

            You can refer to the mesh image example which has the points as well but you would need to zoom in and check them manually.

            These are the exact coordinates that you would need for your use case.



            Unhandled Rejection (Error): The dtype of dict['ImageTensor'] provided in model.execute(dict) must be int32, but was float32
            Asked 2021-Jan-16 at 06:53

            I try to run deep lab model javascript on video here but I get the error Unhandled Rejection (Error): The dtype of dict['ImageTensor'] provided in model.execute(dict) must be int32, but was float32 , here is my code



            Answered 2021-Jan-16 at 06:53

            problem was the tensorflow version , do the following: uninstall current version



            tensorflowjs : show predicted array as image
            Asked 2021-Jan-08 at 11:27

            As in the following js code, I am loading the model as a promise: tf.loadLayersModel('../tfjs-models/hadwritten-digits/model.json')

            Now, I am using model.predict that will return an tensor of shape (1, 128, 128, 1) i.e. one grayscale image. I am having a lot of issue now on with promises and awaits. I have a canvas with known id in index.html, I want to put the image into. Needed some help now.



            Answered 2021-Jan-08 at 09:13

            There are a couple of things that needs to be changed in the code

            • There is not 3d context for now, there is the 2d context.

            • Additionnally, Uint8ClampedArray expects a flatten array. So instead of using array(respectively arraySync), it should rather be data(respectively dataSync).

            • ImageData expects the width and the height of the image. It is unlikely that the image width and height are 1 pixel each. So there might need to change the parameters given to ImageData

            short example



            How to use async loaded assets in sagas with react native?
            Asked 2020-Sep-22 at 17:23

            I am building an Expo app using redux-saga and tensorflow js. The model has to be loaded async when initializing the app. In all the examples, the model is loaded in a component and stored in the component's state.

            I would like however to perform inference in a saga and not directly in the component.

            I don't know how to write the initialization process so as to be able to access the loaded model from within the saga.

            In App.js I have the following:



            Answered 2020-Sep-22 at 17:23

            You'll have to maintain state for this case, like in



            How to convert from Tensorflow.js (.json) model into Tensorflow (SavedModel) or Tensorflow Lite (.tflite) model?
            Asked 2020-Aug-28 at 08:01

            I have downloaded a pre-trained PoseNet model for Tensorflow.js (tfjs) from Google, so its a json file.

            However, I want to use it on Android, so I need the .tflite model. Although someone has 'ported' a similar model from tfjs to tflite here, I have no idea what model (there are many variants of PoseNet) they converted. I want to do the steps myself. Also, I don't want to run some arbitrary code someone uploaded into a file in stackOverflow:

            Caution: Be careful with untrusted code—TensorFlow models are code. See Using TensorFlow Securely for details. Tensorflow docs

            Does anyone know any convenient ways to do this?



            Answered 2020-Aug-28 at 08:01

            You can find out what tfjs format you have by looking in the json file. It often says "graph-model". The difference between them are here.

            From tfjs graph model to SavedModel (more common)

            Use tfjs-to-tf by Patrick Levin.



            TensorFlow JS Face Mesh Uncaught (in promise) TypeError: Cannot read property 'height' of null
            Asked 2020-Aug-07 at 11:07

            I'm attempting to use TensorFlow face mesh(JS) for a simple face tracker. I've used the standard code on the site but I'm getting an error for height: Uncaught (in promise) TypeError: Cannot read property 'height' of null at facemesh:17 at L.estimateFaces (facemesh:17) at main ((index):76)

            I'm new to JS but I can't work out where I am going wrong. Any help would be much appreciated.

            TensorFlow code:




            Answered 2020-Aug-07 at 11:07

            Declare the video element inside the main() function



            load model.json for tensorflowjs in reactjs not working
            Asked 2020-May-16 at 21:57

            I'm trying to load a model.json file with it's weights.bin from the root directory in my react app.

            When I call an example I found online from it works but loading from my root doesn't.

            The contents of App.js in my react app...



            Answered 2020-May-15 at 21:09

            The file URI scheme file://url is only for loading model server side. To load the model in the browser, the user can be prompted to select the model topology(model.json) and weight files. The doc contains an exemple of how to load a model by prompting the user using file input elements.

            If the user is not to be requested to select the model files, then the model needs to be served by a server. The model.json and the weights can for instance be in the assets folder of the application deployed. Then the url would just need to be pointing to the model.json without file:// as follows:



            How to create a spectrogram image from an audio file in Python just like how FFMPEG does?
            Asked 2020-May-02 at 20:46
            My code: ...


            Answered 2020-May-02 at 20:46

            You can directly pipe the audio to ffmpeg which will avoid the intermediate file, and ffmpeg can output to pipe as well if you wanted to avoid image file output.

            Demonstration using three instances of ffmpeg:


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install tfjs-models

            You can download it from GitHub.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone tensorflow/tfjs-models

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Machine Learning Libraries


            by tensorflow


            by ytdl-org


            by tensorflow


            by pytorch


            by keras-team

            Try Top Libraries by tensorflow


            by tensorflowC++


            by tensorflowJupyter Notebook


            by tensorflowTypeScript


            by tensorflowPython


            by tensorflowTypeScript