deepinsight / deepinsight/insightface

diifferent when inference

Open
#2,508 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.8k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

when use pytorch model, img is normalised,
img = torch.from_numpy(img).unsqueeze(0).float()
img.div_(255).sub_(0.5).div_(0.5)

but use onnx model :
batch = (batch - model.input_mean) / model.input_std

it didn't normalise to 0-1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the PyTorch and ONNX inference preprocessing entry points and comparing how each applies input mean and standard deviation. Reproduce the reported normalization difference with the issue's snippets, then verify that both paths produce the intended input range and add or update a focused regression test if the relevant test area is found.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.