1adrianb / 1adrianb/face-alignment

[Contribution suggestion] Allow explicitly passing in model_dir

Ouverte Adaptée aux débutants
#283 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
7.5k
Forks
1.4k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, pytorch
Domaine
backend, cloud
Type d'issue
Fonctionnalité
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
70/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.