onnx / onnx/models

Preprocessing for Age and Gender Classification

Open
#493 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Jupyter Notebook
Stars
9.8k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Ask a Question

What preprocessing should be done with model input?

Question

In README for GoogleNet input image's "mean values are 104, 117, 123" and input tensor "converted to BGR format". However in example code the image is converted to RGB format and mean values array is substracted from input tensor (like image should initially have such mean value and for model input it should have zero mean value).

I couldn't find the step-by-step preprocessing description in original article, so the question is how exactly input should be processed?

Further information

Data Preprocessing

Is this issue related to a specific model?
GoogleNet

Notes

First of all thank you for the work!

I tried different preprocessing ways of example images:

  1. Like in code example
  2. In order to really create image with mean 104, 117, 123 I performed following operation image_mean_new = np.array([104, 117, 123]); image_mean = np.mean(image, axis = (0,1)); image = image - image_mean + image_mean_new

However in both case model demonstrated poor performance :( Will be happy to find the right way to process model inputs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GoogleNet README and vision/body_analysis/age_gender/levi_googlenet.py, then compare their descriptions of BGR/RGB ordering and mean values. Done means the expected input preprocessing is explicitly reconciled between the README and example, with the model-specific steps documented clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.