Code Monkey home page Code Monkey logo

customvision-export-samples's Introduction

Sample scripts for exported models from Custom Vision Service.

This repository contains samples scripts to use exported models from Custom Vision Service.

Language Model type Link
C# ONNX README
C# ONNX & ML.NET README
Javascript TensorFlow.js README
Python CoreML README
Python ONNX README
Python OpenVino README
Python TensorFlow (Frozen Graph) 1 README
Python TensorFlow (Saved Model) README
Python TensorFlow Lite README

How to export a model from Custom Vision Service?

Please see this document.

Notes

Those sample scripts are not aiming to get identical results with Custom Vision's prediction APIs. There are slight differences in the pre-processing logic, which cause small difference in the inference results.

Related sample projects

Language Platform Repository
Java Android https://github.com/Azure-Samples/cognitive-services-android-customvision-sample
Swift, Objective-C iOS https://github.com/Azure-Samples/cognitive-services-ios-customvision-sample

Resources

Footnotes

  1. This is the default export flavor for TensorFlow platform. โ†ฉ

customvision-export-samples's People

Contributors

luisquintanilla avatar microsoft-github-operations[bot] avatar microsoftopensource avatar shonohs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

customvision-export-samples's Issues

Add C# ML.NET Export Sample

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

N/A

Any log messages given by the failure

N/A

Expected/desired behavior

N/A

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Tensorflow Lite Export Produces Model Error

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Create new project with domain General (compact) or General (compact) S1
  2. Train model using Quick Training
  3. Export TensorFlow Lite model
  4. Test model using the sample code in this repo https://github.com/Azure-Samples/customvision-export-samples/blob/main/samples/python/tensorflow_lite/classification/predict.py

Any log messages given by the failure

This is the error provided:

Traceback (most recent call last):
  File "predict.py", line 47, in <module>
    main()
  File "predict.py", line 41, in main
    model = Model(args.model_filepath)
  File "predict.py", line 10, in __init__
    self.interpreter = tensorflow.lite.Interpreter(model_path=str(model_filepath))
  File "/Users/{username}/anaconda3/lib/python3.8/site-packages/tensorflow/lite/python/interpreter.py", line 463, in __init__
    _interpreter_wrapper.CreateWrapperFromFile(
ValueError: Model provided has model identifier '

I also tried adjusting the code to use the tflite runtime instead and it produced the same error:

Traceback (most recent call last):
  File "predict.py", line 47, in <module>
    main()
  File "predict.py", line 41, in main
    model = Model(args.model_filepath)
  File "predict.py", line 10, in __init__
    self.interpreter = tflite.Interpreter(model_path=str(model_filepath))
  File "/Users/{username}/anaconda3/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 348, in __init__
    _interpreter_wrapper.CreateWrapperFromFile(
ValueError: Model provided has model identifier '

Expected/desired behavior

Output of predicted tag

OS and Version?

macOS 10.15.7
python 3.8.12
tensorflow 2.7.0
tflite-runtime 2.5.0.post1

Example for android application

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Do you have any example for Android and custom S1 model TFLite?

Correct color channels/pixelformat for inference withexported model from custom vision

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

OS and Version?

Windows10

Hi everyone,

my question/remark is two-folded and concerns the provided predict.py functions for different model types, tasks and domains for python(find here: https://github.com/Azure-Samples/customvision-export-samples/tree/main/samples/python):

  1. Which is the correct color space of images used for inference with exported models from custom vision?

When i download models, the metadata_properties.json always says that the pixelformat is RGB8. The predict functions on the other hand (almost - see 2nd point) all contain a convertion to BGR like: input_array = input_array[:, :, :, (2, 1, 0)] # => BGR.
Why is that and which color space/pixelformat is used for training?

  1. The mentiond color space conversion is not part of the predict function for the following combination: model type ->tensorflow, task->classification, domain -> General compact [S1] (find here: https://github.com/Azure-Samples/customvision-export-samples/blob/main/samples/python/tensorflow/classification_s1/predict.py).
    Why is that? Or is it just missing?

Thanks alot in advance

TypeError: webglBackend.incRef is not a function

Uncaught (in promise) TypeError: webglBackend.incRef is not a function
at Object.reshape [as kernelFunc] (Reshape.ts:50)
at kernelFunc (engine.ts:576)
at engine.ts:634
at Engine.scopedRun (engine.ts:439)
at Engine.runKernelFunc (engine.ts:631)
at reshape_ (reshape.ts:71)
at reshape__op (operation.ts:50)
at expandDims_ (expand_dims.ts:56)
at expandDims__op (operation.ts:50)
at Tensor.push../node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js.tensor__WEBPACK_IMPORTED_MODULE_1_.Tensor.expandDims (expand_dims.ts:29)

Attempt to load model in react.js. Failed with message shown

Actually i just need the algorithm so calculate the output

Examples of Classification (C#) are no longer available

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Examples of Classification (C#) is no longer available

Any log messages given by the failure

Github error 404 not found

Expected/desired behavior

Code for Classification (C#)

Mention any other details that might be useful

It seems that the code has been removed or unavailable


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.