Comments (5)
There is a lack of normalization of the input image and a lack of numerical conversion after inference.
img = cv2.imread('2-1.jpg')
img = cv2.resize(img, (128, 128))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = img - 127.5
img = img * 0.007843
image_np_expanded = np.expand_dims(img, axis=0)
(pred_classificators , pred_regressors) = persistent_sess.run([classificators , regressors],
feed_dict={img_inputs_face: image_np_expanded})
scores = 1.0 / (1.0 + np.exp(-pred_classificators))
print('scores:', scores)
print('pred_regressors:', pred_regressors)
scores: [[[1.92749663e-04]
[3.74617724e-04]
[6.53379102e-05]
[7.41685581e-05]
[5.91813914e-05]
[2.26559394e-04]
[1.27456326e-04]
[1.55236325e-04]
[2.33076513e-04]
[2.11102131e-04]
:
:
pred_regressors: [[[ -1.0449376 0.12775415 21.445286 ... -1.3779925 2.7564733
-4.6433153 ]
[ -0.97221917 0.34412926 26.561253 ... -0.48758936 3.127716
-6.060492 ]
[ -0.5468276 -1.4531596 20.107094 ... -1.6310003 6.432667
-6.4479685 ]
...
[ -1.5552132 -6.239525 86.65577 ... -15.01696 12.402348
3.2532141 ]
[ -1.292839 -8.317465 96.59374 ... -16.379583 14.803879
1.740176 ]
[ -1.857463 -10.383455 107.36553 ... -20.176395 18.376274
-0.34014758]]]
from pinto_model_zoo.
I get very low score of 0.00013611263 .... 8.4253545e-05
How to interpret in normal probabilities 0% - 100%
?
from pinto_model_zoo.
There is a lack of normalization of the input image and a lack of numerical conversion after inference.
img = img - 127.5 img = img * 0.007843
I understand the input has to be normalized [-1 ... 1] not [0...1] (as documented in the model card but to be fair they also are missing the z value in the output..)
May I ask where you got it from? Is this meant to support mean-subtraction, and, in that case, shouldn't the mean values of the training set be used?
In any case, the output I get is quite similar for both ranges..
Edit: The new model you recently added has an additional value for every keypoint... any idea what it is?
from pinto_model_zoo.
I understand that I need to calibrate using the data set used during training. I will follow the exact description in the document if there is one. The normalization range was used in a crude way to predict a likely value. This is because I don't know the correct way to normalize. I don't know the data set either.
If you guys are dissatisfied with the accuracy, you can easily invert the model using the tool below. The dataset used for calibration and the range of normalization can be changed by yourself by adjusting the tool parameters. The last model I converted only used this tool to perform a normalization of RGB/255. But I don't know the certainty of that value.
https://github.com/PINTO0309/tflite2tensorflow
from pinto_model_zoo.
I'm not sure I get the concept of what you propose, wouldn't setting custom normalization values have to affect all the model weights too?
from pinto_model_zoo.
Related Issues (20)
- Zoedepth ONNX conversion Script HOT 3
- gfpgan coreml model HOT 1
- License of RAFT models HOT 3
- Script to convert RAFT models HOT 3
- Blazeface onnx model HOT 1
- BodyPix on MacOS - Dilation not supported for AutoPadType::SAME_UPPER or AutoPadType::SAME_LOWER HOT 8
- TOPK operator for RKNN export HOT 1
- InstructIR
- 064_Dense_Depth seems to have wrong dimensions HOT 1
- Midas2 model on coral edge TPU HOT 1
- Difference on model outputs (tflite, openvino IR, and Onnx) in model 227_face-detection-adas-0001 HOT 1
- bad results for 342_ALIKE HOT 1
- Aborted (core dumped) for full quantized tinyhitnet model
- 091_gaze-estimation-adas-0002 network HOT 1
- Release new 303_FAN with heatmaps HOT 3
- dataset HOT 1
- 410_FaceMeshV2 quantized tflite models are not functional HOT 1
- 053_BlazePose / 058_BlazePose_Full_Keypoints source HOT 3
- How to retrain simple MLP (palm_detection_full_inf_post_192x192.onnx) model with custom hand dataset ? HOT 2
- How to retrain simple MLP (palm_detection_full_inf_post_192x192.onnx) model with custom hand dataset ? HOT 2
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 pinto_model_zoo.