服装关键点检测开源项目教程

服装关键点检测开源项目教程

FashionAI-KeyPointsDetectionOfApparel FashionAI Key Points Detection using CPN model in Pytorch FashionAI-KeyPointsDetectionOfApparel 项目地址: https://gitcode.com/gh_mirrors/fa/FashionAI-KeyPointsDetectionOfApparel

1. 项目介绍

本项目是基于 FashionAI 的服装关键点检测任务的开源实现,使用 PyTorch 框架,并采用级联金字塔网络(Cascaded Pyramid Network,CPN)模型。该模型能够对五种类型的服装(衬衫、连衣裙、外套、裙子、裤子)进行关键点检测。本项目在 FashionAI 全球挑战赛中取得了优异的成绩,并在实践中证明了其有效性。

2. 项目快速启动

环境准备

  • Python 3.5
  • Numpy
  • Pandas
  • PyTorch
  • cv2(OpenCV)
  • scikit-learn
  • py3nvml 和 nvidia-ml-py3
  • tqdm

数据准备

首先,下载 FashionAI 数据集,并将其解压到以下结构:

DATA_DIR/
|-- wu_train/
|    |-- Annotations/
|    |    |-- annotations.csv
|    |-- Images/
|    |    |-- blouse
|    |    |-- ...
|-- r1_train/
|    |-- Annotations/
|    |    |-- annotations.csv
|    |-- Images/
|    |    |-- blouse
|    |    |-- ...
|-- ...

config.py 文件中,指定数据保存目录 proj_path 和数据集根目录 data_dir

预训练模型

本项目使用了预训练的 ResNet152 和 SENet154 模型作为主干网络。

训练

设置训练的超参数,如批量大小、CUDA 设备、学习率等,在 config.py 文件中。

  • 从头开始训练:
python3 src/stage2/trainval.py -c {clothing type}

其中 {clothing type} 应为以下五种类型之一:衬衫(blouse)、连衣裙(dress)、外套(outware)、裙子(skirt)、裤子(trousers)。

  • 从检查点恢复训练:
python3 src/stage2/trainval.py -c {clothing type} -r {path/to/the/checkpoint}

3. 应用案例和最佳实践

推理

在验证集上评估单个模型:

python3 src/stage2/predict_one.py -c {clothing type} -g {gpu index} -m {path/to/the/model} -v {True/False}

测试两个模型的集成性能:

python3 src/stage2/predict_ensemble.py -c {clothing type} -g {gpu index} -m1 {path/to/the/model1} -m2 {path/to/the/model2} -v {True/False}

生成测试集提交文件

测试单个模型:

python3 src/kpdetector/predict_one.py -c {clothing type} -g {gpu index} -m {path/to/the/model} -v {True/False}

测试两个模型的集成性能:

python3 src/kpdetector/predict_ensemble.py -c {clothing type} -g {gpu index} -m1 {path/to/the/model1} -m2 {path/to/the/model2} -v {True/False}

合并所有结果到一个 .csv 文件用于提交:

python3 src/kpdetector/concatenate_results.py

4. 典型生态项目

本项目的生态系统中,以下是一些值得关注的典型项目:

  • FashionAI 官方数据集
  • PyTorch 深度学习框架
  • 级联金字塔网络(CPN)模型的相关研究论文

以上是本项目的基本教程,希望对您的学习和使用有所帮助。

FashionAI-KeyPointsDetectionOfApparel FashionAI Key Points Detection using CPN model in Pytorch FashionAI-KeyPointsDetectionOfApparel 项目地址: https://gitcode.com/gh_mirrors/fa/FashionAI-KeyPointsDetectionOfApparel

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

强和毓Hadley

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值