dk - edit

This commit is contained in:
2026-08-20 16:31:40 +09:00
parent e215ff3b41
commit 2aee353809
9 changed files with 684 additions and 5 deletions
+27 -3
View File
@@ -1,11 +1,12 @@
# Market-1501 Person Attribute Recognition
이미지 URL과 사람 영역(`xywh`)으로 나이, 성별, 의상 색상 등 Market-1501 속성을 추론합니다.
이미지 URL(또는 로컬 경로)과 사람 영역(`xywh`)으로 나이, 성별, 의상 색상 등 Market-1501 속성을 추론합니다.
`person_attr.py` `net_last.pth` 같은 디렉터리에 두고 실행하세요.
가중치 파일 `net_last.pth` `person_attr.py` 같은 디렉터리에 두세요.
## 로컬 추론
```bash
pip install -r requirements.txt
uv run python person_attr.py \
--image_url "https://example.com/image.jpg" \
--xywh "404,290,74,193"
@@ -15,3 +16,26 @@ uv run python person_attr.py \
- `--xywh`: 좌상단 기준 `x,y,w,h`
결과는 ClearML Task(`Person_Attribute_Recognition` / `person_attribute`)에 `final_result` artifact로 업로드됩니다.
## 모델 등록
ClearML에 `net_last.pth`를 등록하고 Model ID를 출력합니다.
```bash
$ uv run python register_models.py
ClearML Task: created new task id=4b8598d8fec24432bd9e0d85326873fd
ClearML results page: http://203.254.171.99:20680/projects/d9ea04a0ba33464e9c6af8a07bfd54b2/tasks/4b8598d8fec24432bd9e0d85326873fd/output/log
Registering Person Attribute Model (net_last.pth)...
2026-08-20 16:21:06,923 - clearml.model - INFO - No output storage destination defined, registering local model net_last.pth
------------------------------
Person Attr Model ID: 246dd122ed2b4c81bddbeea33e859498
------------------------------
$
```
## Serving
ClearML Serving용 진입점은 다음 파일입니다.
- `serve_roformer.py`: `PersonAttrService` (모델 로드 / `predict`)
- `preprocess.py`: 요청 JSON의 `url` 또는 `image_url``xywh`를 전처리