1adrianb / 1adrianb/face-alignment

[Contribution suggestion] Allow explicitly passing in model_dir

未关闭 适合新手
#283 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
7.5k
派生
1.4k
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
python, pytorch
领域
backend, cloud
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
70/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。