Comments (4)
As you've noticed, Codegen does support per channel normalization through metadata, same as TFLite Task library .
The comments have been updated. See here. Let me know if it makes sense to you.
from tflite-support.
Yes, I don't think tf.image support per channel normalization. Usually this is done simply by
VGG_MEAN = [123.68, 116.78, 103.94]
input_img_norm = (input_img - tf.constant(VGG_MEAN)) / 255.0
What does it mean: "except that the input is a UINT8 Tensor?
It means if the input tensor is UINT8, and if mean is 0 and stddev is 1, the returned TensorBuffer will not be a FLOAT32 tensor, but a UINT8 tensor, because the original input tensor is returned.
I'll update the comment shortly.
from tflite-support.
It looks like the codegen which uses support library already does this. After adding the appropriate metadata using Python, the relevant codegen is:
.add(new NormalizeOp(metadata.getImageMean(), metadata.getImageStddev()));
where the generated class Metadata
contains
public float[] getImageMean() {
return Arrays.copyOf(imageMean, imageMean.length);
}
I will leave it open for you to update the comment? Thanks for your reply.
from tflite-support.
Closing the issue. Feel free to reopen it if you have other questions.
from tflite-support.
Related Issues (20)
- Getting "Cannot copy to a TensorFlowLite tensor (serving_default_input_1:0) with 63984 bytes from a Java Buffer with 64000 bytes" error while attempting to pass the Input and Output TensorAudio Buffer to TFLite Interpreter for inference HOT 1
- ImportError from image_utils HOT 4
- Could you please provide a aarch64 tflite-support wheel for python 3.10 HOT 2
- YOLOv8 `tensorflow>=2.14.0` ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined HOT 6
- How to read .wav in adroid jni?
- `tf.lite`, or `tflite_tuntime.interpreter as `tflite`?
- TensorFlowLiteTaskAudio for iOS: How to save audio and then play it
- ERROR: Could not find a version that satisfies the requirement tflite-support==0.4.4 HOT 4
- Installation Error: Unable to find installation candidates for tflite-support (0.4.4) HOT 1
- Build TensorFlowLiteTaskVision_framework failed HOT 2
- How to handle dynamic output tensors with `tflite.runForMultipleInputsOutputs`
- iOS Error duplicate symbols HOT 2
- 0.4.2 and 0.4.3 versions of the pod are crashing on app launch on iOS 12.5.7
- Quantization with tflite : Unexpected input data type. Actual: (tensor(float)) , expected: (tensor(int8))
- How to install tflite_support in pip by source compiling HOT 3
- Possibility of channel-by-channel image normalization when adding metadata
- Document TFLite Support vs MediaPipe HOT 2
- No 0.4.4 PyPi package available for Arm/Python 3.11 HOT 1
- Model Loading Error for Image Embedder in Android
- MobileNetV3 quantization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tflite-support.