1adrianb / 1adrianb/face-alignment

[Contribution suggestion] Allow explicitly passing in model_dir

Aperta Adatta ai principianti
#283 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
7.5k
Fork
1.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi @1adrianb

Lovely package, first of all. I was testing it, and ran into (and have resolved in a fork) an issue with deploying to AWS Lambda:

* AWS Lambda only allows IO writes to the /tmp/ directory namespace
* The current package defaults to the `get_dir` from torch.hub which is not within that namespace
* Result: No models run on AWS Lambda from what I can deduce

Fix/enhancement (easy): Add `model_dir: str = None` to each of the `__init__` for classes that use torch URL-loading functions. Downstream functions already support the explicit model_dir, but top-level class initialization e.g. in `api.py` module doesn't.

If you agree, I am happy to send you a PR on it:)

Best, Thoger.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

The issue points to the `api.py` module where class `__init__` methods need a `model_dir` parameter. Start by examining the torch.hub loading calls in those classes. The downstream functions already support `model_dir`, so trace where the model is loaded and ensure the parameter is passed through. Test by running a simple inference to verify models can be loaded from a custom directory like /tmp.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, pytorch
Ambito
backend, cloud
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
70/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.