deepinsight / deepinsight/insightface

Questions about RetinaFace.center_cache in Python package

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

Description

Hi, I was reading thru the code to see if I could run a RetinaFace object in parallel for CPU execution, that is, run it in multiple threads simultaneously, and I have a few questions:

1. Why is the size of this center_cache limited to 100 ? If it helps to use a cache, it seems 100 is an incredibly small size.

2. If I didn't miss anything, center_cache is the only instance-variable of RetinaFace class that's changed by detect() (actually detect() calls forward() which changes center_cache). As far as I can tell, this is the only thing that prevent us from using a single RetinaFace object in multiple threads simultaneously. Is this correct ? If so, does it make sense for detect() to have a center_cache parameter ? If this parameter is None, the code can default to using self.center_cache, and thus maintaining the current behavior.

3. It seems the cache is based on input size and stride values. So does it make sense to require input size in either __init__() or prepare(), and pre-calculate/build the entire cache then ? For detection in large amount of images, this should be a simpler and faster approach.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.