pycoral | Python API for ML | Machine Learning library

 by   google-coral Python Version: v2.0.0 License: Apache-2.0

kandi X-RAY | pycoral Summary

kandi X-RAY | pycoral Summary

pycoral is a Python library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Tensorflow applications. pycoral has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

This repository contains an easy-to-use Python API that helps you run inferences and perform on-device transfer learning with TensorFlow Lite models on Coral devices. To install the prebuilt PyCoral library, see the instructions at coral.ai/software/. Note: If you're on a Debian system, be sure to install this library from apt-get and not from pip. Using pip install is not guaranteed compatible with the other Coral libraries that you must install from apt-get. For details, see coral.ai/software/.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pycoral has a low active ecosystem.
              It has 220 star(s) with 96 fork(s). There are 20 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 15 open issues and 90 have been closed. On average issues are closed in 51 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pycoral is v2.0.0

            kandi-Quality Quality

              pycoral has 0 bugs and 11 code smells.

            kandi-Security Security

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

            kandi-License License

              pycoral 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

              pycoral releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              pycoral saves you 1154 person hours of effort in developing the same functionality from scratch.
              It has 2865 lines of code, 224 functions and 46 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pycoral and discovered the below as its top functions. This is intended to give you an instant insight into pycoral implemented functionality, and help decide if they suit your requirements.
            • Trains the model
            • Yield a test image
            • Create a tflite Interpreter object
            • Return a list of image paths
            • Extract embeddings from images
            • Runs the given model
            • Get the input tensor
            • Return the input details for the given key
            • Run two TFUses on the same model
            • Opens an image file
            • Read a label file
            • Resize input tensor
            • Generate tile locations
            • Runs an inference job
            • Read a reference model from a csv file
            • Prepare images
            • Reposition bounding box
            • Reads and train and test sets
            • Return list of connected devices
            • Convert a label to a color image
            • Push input tensors to the runner
            • Run inference
            • R Compute the suppression of a non - maximum suppression
            • Prepare a benchmark for training
            • Run two models
            • Create a TFLite Interpreter object
            • Parse command line arguments
            Get all kandi verified functions for this library.

            pycoral Key Features

            No Key Features are available at this moment for pycoral.

            pycoral Examples and Code Snippets

            No Code Snippets are available at this moment for pycoral.

            Community Discussions

            QUESTION

            Output tensor from tflite interpreter is squeezed
            Asked 2022-Feb-04 at 14:57

            I'm trying to get a YOLOv5s model to run on a Coral EdgeTPU. Ive followed the instructions in the YOLOv5 repository for conversion from the yolov5s.pt model to the yolov5s-int8_edgetpu.tflite model.

            After cloning the pycoral repository, they provide a detect_image.py script. When using their model, the script executes with no errors.

            If I run the same script with my yolov5s-int8_edgetpu.tflite model I get this error:

            ...

            ANSWER

            Answered 2022-Feb-04 at 14:57

            Since the Yolov5s model has a different input file than the EfficientDet, the output tensor will be different. The trick here is understanding how to process this output tensor.

            Fortunately, Ultralytics/Yolov5 held an export competition where the goal was to execute Yolov5 models on EdgeTPU devices.

            This guy Josh won the coral devboard section. He wrote python library to process these wonky tensor outputs from Yolov5s models. Here is the repo. The real processing of the output tensor is done in his non-max-suppression code.

            I've forked his repo and added the ability to execute/process these Yolov5s models on desktops.

            Thanks so much Josh!

            Source https://stackoverflow.com/questions/70947940

            QUESTION

            "IndexError: index 10 is out of bounds for axis 0 with size 10" when running inference on Coral Dev Board
            Asked 2021-Dec-28 at 21:28

            I'm trying to run a quantized and Edge-TPU-compiled Tensorflow object detection model on a Coral Dev Board.

            My Code:

            ...

            ANSWER

            Answered 2021-Dec-28 at 21:28

            It seems to be a bug in the PyCoral API. To solve the issue, I replaced the last line from the "detect.py"-file (in my case located in "/usr/lib/python3/dist-packages/pycoral/adapters/detect.py") with this updated line:

            return [make(i) for i in range(len(scores)) if scores[i] >= score_threshold]

            Source https://stackoverflow.com/questions/70511953

            QUESTION

            Image classification using tensorflow lite without Google Coral USB
            Asked 2021-Jul-16 at 09:20

            I am trying to evaluate a Raspberry Pi performance with a Google Goral Edge TPU USB device and without it for an image classification task on a video file. I have managed to evaluate the peformance using the Edge TPU USB device already. However, when I try running a tensorflow lite code to run inference it gets me an error that tells me I need to plugin the device:

            ...

            ANSWER

            Answered 2021-Jul-16 at 09:20

            I recently came into this for a thesis supervision. We tested face detection in a raspberry pi 4 with Coral USB an without (inference on rpi CPU). Are you using the same model file for both? If this is the case, then this is the problem. You need to use the bare tflite model for the CPU inference and the TPU-compiled model for the inference with TPU. You can take a look at this repo where you can find the code I was mentioned before (it's not well documented but it's working, look at the inference CPU and inference CORAL files).

            Source https://stackoverflow.com/questions/68402726

            QUESTION

            Installing Coral Edge TPU software gives me "ModuleNotFoundError: No module named 'pycoral.adapters'" error
            Asked 2021-Jun-04 at 03:30

            I am trying to install the Coral Edge TPU software on MacOS 11.5 by following these instructions:

            https://coral.ai/docs/accelerator/get-started/#3-run-a-model-on-the-edge-tpu

            But by the time I enter the following command into the console:

            ...

            ANSWER

            Answered 2021-Jun-04 at 03:30

            I have the same issue on Windows 10. If you are using Python 3.9.x, and used the command pip3 install --extra-index-url https://google-coral.github.io/py-repo/ pycoral to install pycoral, then you will be installing a very old version of pycoral which does not have pycoral.adapters module. I think this is because the pycoral repo currently (June 2021) does not have the package built for Python 3.9.x.

            The solution is to either build and install pycoral from source on your Mac using Python 3.9.x, or downgrade Python to 3.8.x and install pycoral again.

            Source https://stackoverflow.com/questions/67807906

            QUESTION

            Coral Dev Board - edgetpu_demo: command not found
            Asked 2021-Feb-04 at 04:18

            Today I started to use my Coral Dev Board and followed these instructions. When I try to run the demo app with edgetpu_demo --stream, I get the following error message:

            -bash: edgetpu_demo: command not found

            Running a model using the PyCoral API works fine.

            Is there a new command for the demo app or did I do something wrong?

            ...

            ANSWER

            Answered 2021-Feb-04 at 04:18

            The edgetpu_demo command does not work because the Edge TPU API is deprecated. The Get started with the Dev Board guide is out of date in this case because the necessary modules to execute edgetpu commands are not installed.

            Here you can find the packages that would have to be installed manually afterwards. However, these can no longer be installed from the official sources. Instead you could install the old packages from the archive.

            Note: The Edge TPU API has been replaced by the PyCoral API and should be preferred instead.

            Source https://stackoverflow.com/questions/65988751

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

            Vulnerabilities

            No vulnerabilities reported

            Install pycoral

            You can download it from GitHub.
            You can use pycoral like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            To learn more about how to use the PyCoral API, see our guide to Run inference on the Edge TPU with Python and check out the PyCoral API reference. Several Python examples are available in the examples/ directory. For instructions, see the examples README.
            Find more information at:

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

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/google-coral/pycoral.git

          • CLI

            gh repo clone google-coral/pycoral

          • sshUrl

            git@github.com:google-coral/pycoral.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link