Upload 2 files
Browse files- README.md +41 -144
- README_CN.md +62 -0
README.md
CHANGED
|
@@ -1,168 +1,65 @@
|
|
| 1 |
-
|
| 2 |
-
license: mit
|
| 3 |
-
task_categories:
|
| 4 |
-
- image-to-3d
|
| 5 |
-
tags:
|
| 6 |
-
- pose-estimation
|
| 7 |
-
- 6d-pose-estimation
|
| 8 |
-
- 3d-reconstruction
|
| 9 |
-
- object-detection
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
# HccePose (BF) Dataset
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
**
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
<a href="https://arxiv.org/abs/2510.10177">
|
| 20 |
-
<img src="https://img.shields.io/badge/arXiv-2510.10177-B31B1B.svg?logo=arxiv" alt="arXiv">
|
| 21 |
-
</a>
|
| 22 |
-
<a href="https://huggingface.co/datasets/SEU-WYL/HccePose">
|
| 23 |
-
<img src="https://img.shields.io/badge/HuggingFace-HccePose-FFD21E.svg?logo=huggingface&logoColor=white" alt="HuggingFace">
|
| 24 |
-
</a>
|
| 25 |
-
</p>
|
| 26 |
|
| 27 |
-
|
| 28 |
-
HccePose represents the state-of-the-art method for 6D object pose estimation based on a single RGB image. It introduces a **Hierarchical Continuous Coordinate Encoding (HCCE)** scheme, which encodes the three coordinate components of object surface points into hierarchical continuous codes. Through this hierarchical encoding, the neural network can effectively learn the correspondence between 2D image features and 3D surface coordinates of the object.
|
| 29 |
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
### <img src="https://github.com/WangYuLin-SEU/HCCEPose/blob/main/show_vis/fig2.jpg" width=100%>
|
| 34 |
|
| 35 |
-
##
|
| 36 |
-
### 🔹 Object Preprocessing
|
| 37 |
-
- Object renaming and centering
|
| 38 |
-
- Rotation symmetry calibration (8 symmetry types) based on [**KASAL**](https://github.com/WangYuLin-SEU/KASAL)
|
| 39 |
-
- Export to [**BOP format**](https://github.com/thodan/bop_toolkit)
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
- Preparation of **front** and **back** surface 3D coordinate labels
|
| 49 |
-
- Distributed training (DDP) implementation of **HccePose**
|
| 50 |
-
- Testing and visualization via **Dataloader**
|
| 51 |
-
- **HccePose (YOLOv11)** inference and visualization on:
|
| 52 |
-
- Single RGB images
|
| 53 |
-
- RGB videos
|
| 54 |
|
| 55 |
-
##
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
-
|
| 64 |
-
- Directly perform **2D detection**, **2D segmentation**, and **6D pose estimation** using the pretrained weights provided in this project
|
| 65 |
-
|
| 66 |
-
---
|
| 67 |
|
| 68 |
-
##
|
| 69 |
-
> Please keep the folder hierarchy unchanged.
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
| 🎨 Object 3D Models | [models](https://huggingface.co/datasets/SEU-WYL/HccePose/tree/main/demo-bin-picking/models) |
|
| 74 |
-
| 📁 YOLOv11 Weights | [yolo11](https://huggingface.co/datasets/SEU-WYL/HccePose/tree/main/demo-bin-picking/yolo11) |
|
| 75 |
-
| 📂 HccePose Weights | [HccePose](https://huggingface.co/datasets/SEU-WYL/HccePose/tree/main/demo-bin-picking/HccePose) |
|
| 76 |
-
| 🖼️ Test Images | [test_imgs](https://huggingface.co/datasets/SEU-WYL/HccePose/tree/main/test_imgs) |
|
| 77 |
-
| 🎥 Test Videos | [test_videos](https://huggingface.co/datasets/SEU-WYL/HccePose/tree/main/test_videos) |
|
| 78 |
|
| 79 |
-
|
| 80 |
-
Files beginning with `train_` are only required for training.
|
| 81 |
-
For this **Quick Start** section, only the above test files are needed.
|
| 82 |
|
| 83 |
-
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
First, ensure you have the required environment set up as described in the [GitHub repository's `Environment Setup` section](https://github.com/WangYuLin-SEU/HCCEPose#%EF%B8%8F-environment-setup).
|
| 90 |
-
|
| 91 |
-
Then, you can use the following Python script. Make sure to adjust `dataset_path` to point to the local directory where you have cloned or downloaded the contents of this Hugging Face repository.
|
| 92 |
-
|
| 93 |
-
Example input image 👇
|
| 94 |
-
<div align="center">
|
| 95 |
-
<img src="https://github.com/WangYuLin-SEU/HCCEPose/blob/main/test_imgs/IMG_20251007_165718.jpg" width="40%">
|
| 96 |
-
</div>
|
| 97 |
-
|
| 98 |
-
Source image: [Example Link](https://github.com/WangYuLin-SEU/HCCEPose/blob/main/test_imgs/IMG_20251007_165718.jpg)
|
| 99 |
-
|
| 100 |
-
```python
|
| 101 |
-
import cv2
|
| 102 |
-
import numpy as np
|
| 103 |
-
from HccePose.tester import Tester
|
| 104 |
-
from HccePose.bop_loader import bop_dataset
|
| 105 |
-
import os
|
| 106 |
-
|
| 107 |
-
if __name__ == '__main__':
|
| 108 |
-
# Adjust this path to where you have cloned/downloaded the Hugging Face dataset repository.
|
| 109 |
-
# For example, if you cloned the repo to './HccePose', then:
|
| 110 |
-
base_repo_path = '.' # Assuming script is run from the root of the cloned HF repo
|
| 111 |
-
|
| 112 |
-
dataset_path = os.path.join(base_repo_path, 'demo-bin-picking')
|
| 113 |
-
bop_dataset_item = bop_dataset(dataset_path)
|
| 114 |
-
|
| 115 |
-
CUDA_DEVICE = '0' # Specify your CUDA device if available, 'cpu' otherwise
|
| 116 |
-
show_op = True # Set to True to display visualizations
|
| 117 |
-
|
| 118 |
-
Tester_item = Tester(bop_dataset_item, show_op=show_op, CUDA_DEVICE=CUDA_DEVICE)
|
| 119 |
-
|
| 120 |
-
obj_id = 1
|
| 121 |
-
image_name = 'IMG_20251007_165718'
|
| 122 |
-
image_file_path = os.path.join(base_repo_path, 'test_imgs', f'{image_name}.jpg')
|
| 123 |
-
|
| 124 |
-
if not os.path.exists(image_file_path):
|
| 125 |
-
print(f"Error: Image file not found at {image_file_path}. Please ensure the HF dataset is downloaded correctly.")
|
| 126 |
-
else:
|
| 127 |
-
image = cv2.cvtColor(cv2.imread(image_file_path), cv2.COLOR_RGB2BGR)
|
| 128 |
-
|
| 129 |
-
# Example camera intrinsics (from GitHub README)
|
| 130 |
-
cam_K = np.array([
|
| 131 |
-
[2.83925618e+03, 0.00000000e+00, 2.02288638e+03],
|
| 132 |
-
[0.00000000e+00, 2.84037288e+03, 1.53940473e+03],
|
| 133 |
-
[0.00000000e+00, 0.00000000e+00, 1.00000000e+00],
|
| 134 |
-
])
|
| 135 |
-
|
| 136 |
-
results_dict = Tester_item.perdict(cam_K, image, [obj_id],
|
| 137 |
-
conf=0.85, confidence_threshold=0.85)
|
| 138 |
-
|
| 139 |
-
# Save visualization results to an 'output_results' directory
|
| 140 |
-
output_dir = './output_results'
|
| 141 |
-
os.makedirs(output_dir, exist_ok=True)
|
| 142 |
-
cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_2d.jpg'), results_dict['show_2D_results'])
|
| 143 |
-
cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_6d_vis0.jpg'), results_dict['show_6D_vis0'])
|
| 144 |
-
cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_6d_vis1.jpg'), results_dict['show_6D_vis1'])
|
| 145 |
-
cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_6d_vis2.jpg'), results_dict['show_6D_vis2'])
|
| 146 |
-
print(f"Results saved to {output_dir}")
|
| 147 |
```
|
| 148 |
|
| 149 |
-
|
|
|
|
| 150 |
|
| 151 |
-
|
| 152 |
|
| 153 |
-
|
| 154 |
|
| 155 |
---
|
| 156 |
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
- HCCE-based front and back surface coordinate encodings
|
| 160 |
-
|
| 161 |
-
- Object mask
|
| 162 |
-
|
| 163 |
-
- Decoded 3D coordinate visualizations
|
| 164 |
-
|
| 165 |
-
<div align="center"> <img src="https://github.com/WangYuLin-SEU/HCCEPose/blob/main/show_vis/IMG_20251007_165718_show_6d_vis0.jpg" width="100%">
|
| 166 |
-
<img src="https://github.com/WangYuLin-SEU/HCCEPose/blob/main/show_vis/IMG_20251007_165718_show_6d_vis1.jpg" width="100%"> </div>
|
| 167 |
-
|
| 168 |
-
---
|
|
|
|
| 1 |
+
# HccePose — Hugging Face dataset note
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
**Dataset card:** publish this file as **`README.md`** at the root of the [`SEU-WYL/HccePose`](https://huggingface.co/datasets/SEU-WYL/HccePose) dataset repository (this is separate from the long GitHub project README).
|
| 4 |
|
| 5 |
+
This file is a **short index** for the dataset [`SEU-WYL/HccePose`](https://huggingface.co/datasets/SEU-WYL/HccePose).
|
| 6 |
+
Full tutorials, training, and BOP workflows are on **GitHub**: [HCCEPose](https://github.com/WangYuLin-SEU/HCCEPose).
|
| 7 |
|
| 8 |
+
## Download script (GitHub only — not in this dataset repo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
The helper that pulls files **from** Hugging Face **into** a local HCCEPose clone lives in the **code** repository, not in the dataset file tree:
|
|
|
|
| 11 |
|
| 12 |
+
- Script: [`scripts/download_hf_assets.py`](https://github.com/WangYuLin-SEU/HCCEPose/blob/main/scripts/download_hf_assets.py)
|
| 13 |
+
- Folder: [`scripts/`](https://github.com/WangYuLin-SEU/HCCEPose/tree/main/scripts)
|
| 14 |
|
| 15 |
+
Clone [HCCEPose](https://github.com/WangYuLin-SEU/HCCEPose), `cd` to the repo root, install `huggingface_hub`, then run the commands below. That matches how the maintainers document Quick Start and RGB-D examples.
|
|
|
|
| 16 |
|
| 17 |
+
## Local paths after download (same as a prepared dev tree)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
By default the script writes under the **HCCEPose repository root** (`--dest` defaults to the parent of `scripts/`).
|
| 20 |
+
Dataset paths on disk mirror the Hugging Face layout **without** an extra `SEU-WYL/HccePose` prefix, for example:
|
| 21 |
|
| 22 |
+
| After `--preset …` | You get (under repo root) | Used by |
|
| 23 |
+
|--------------------|---------------------------|---------|
|
| 24 |
+
| `test` | `test_imgs/`, `test_videos/`, `test_imgs_RGBD/` | `s4_p3_test_mi10_bin_picking.py`, RGB-D scripts (`capture_dir` / `test_img_path` next to repo root) |
|
| 25 |
+
| `dataset` | `demo-bin-picking/` (models, yolo11, HccePose, …) | `bop_dataset(..., 'demo-bin-picking')` |
|
| 26 |
+
| `tex` | `demo-tex-objs/` | textured / video-style demos |
|
| 27 |
+
| `weights` | `demo-bin-picking/models|yolo11|HccePose/` only | lighter pull if you already have the rest of `demo-bin-picking/` |
|
| 28 |
|
| 29 |
+
So a machine that ran the right presets should look the same as one where you manually copied those folders from the dataset browser — **paths align with the example scripts** (`os.path.join(current_dir, 'test_imgs')`, `demo-bin-picking`, `test_imgs_RGBD`, etc.) when you run tests from the repo root as in the README.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
## Layout (Quick Start & tests)
|
| 32 |
|
| 33 |
+
| Path | Purpose |
|
| 34 |
+
|------|---------|
|
| 35 |
+
| `demo-bin-picking/` | BOP-style demo scene: `models/`, `yolo11/`, `HccePose/` weights, etc. |
|
| 36 |
+
| `demo-tex-objs/` | Alternate textured demo (models / YOLO / HccePose) for video-style examples. |
|
| 37 |
+
| `test_imgs/` | RGB images for single-image Quick Start. |
|
| 38 |
+
| `test_videos/` | Clips for video examples. |
|
| 39 |
+
| `test_imgs_RGBD/` | RGB-D sample frames: `{stem}_rgb.png`, `{stem}_depth.png`, `{stem}_camK.json` (e.g. `000000`–`000003`). |
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
## RGB-D conventions
|
|
|
|
| 42 |
|
| 43 |
+
- **`camK.json`**: includes at least `fx`, `fy`, `cx`, `cy` (see `Refinement/refinement_test_utils.load_capture_frame` on GitHub).
|
| 44 |
+
- **Depth**: raw `uint16` PNG; scaling to meters follows `convert_depth_to_meter` in the same module (median-based scale inference).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
## Bulk download (official vs China mirror)
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
From the **GitHub** repo root (after `git clone`):
|
| 49 |
|
| 50 |
+
```bash
|
| 51 |
+
python scripts/download_hf_assets.py --preset test --endpoint auto
|
| 52 |
+
python scripts/download_hf_assets.py --preset dataset --endpoint auto
|
| 53 |
+
python scripts/download_hf_assets.py --preset all --endpoint auto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
+
`--endpoint auto` tries `huggingface.co` first, then falls back to `https://hf-mirror.com`.
|
| 57 |
+
Run `python scripts/download_hf_assets.py --help` for presets (`test`, `dataset`, `tex`, `weights`, `all`) and optional FoundationPose mirror (`--foundationpose`).
|
| 58 |
|
| 59 |
+
## License
|
| 60 |
|
| 61 |
+
Dataset card on Hugging Face lists the dataset license; third-party weights (e.g. FoundationPose) remain under their respective licenses.
|
| 62 |
|
| 63 |
---
|
| 64 |
|
| 65 |
+
*Short Chinese index: [README_CN.md](README_CN.md).*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README_CN.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HccePose — Hugging Face 数据集简要说明
|
| 2 |
+
|
| 3 |
+
**说明:** Hugging Face 数据集仓库根目录的 Dataset card **默认读取英文 `README.md`**。可将 [README.md](README.md) 中内容用于网页卡片;本文 `README_CN.md` 供中文读者在 GitHub 上对照阅读。
|
| 4 |
+
|
| 5 |
+
本文档是 Hugging Face 数据集 [`SEU-WYL/HccePose`](https://huggingface.co/datasets/SEU-WYL/HccePose) 的**简短索引**(非 GitHub 完整 README)。
|
| 6 |
+
完整教程、训练与 BOP 流程见 **GitHub**:[HCCEPose](https://github.com/WangYuLin-SEU/HCCEPose)。
|
| 7 |
+
|
| 8 |
+
## 下载脚本(仅在 GitHub 代码仓,不在本数据集文件里)
|
| 9 |
+
|
| 10 |
+
从 Hugging Face **拉取数据到本地** 的脚本在 **HCCEPose 源码仓库**,不在数据集仓库的文件列表中:
|
| 11 |
+
|
| 12 |
+
- 脚本:[download_hf_assets.py](https://github.com/WangYuLin-SEU/HCCEPose/blob/main/scripts/download_hf_assets.py)(路径 `scripts/download_hf_assets.py`)
|
| 13 |
+
- 目录:[scripts/](https://github.com/WangYuLin-SEU/HCCEPose/tree/main/scripts)
|
| 14 |
+
|
| 15 |
+
请先 `git clone` [HCCEPose](https://github.com/WangYuLin-SEU/HCCEPose),在**仓库根目录**执行下文命令(并安装 `huggingface_hub`)。这与 README 里 Quick Start / RGB-D 的路径约定一致。
|
| 16 |
+
|
| 17 |
+
## 下载后的本地路径(与已配好数据的开发环境一致)
|
| 18 |
+
|
| 19 |
+
默认 **`--dest`** 为 HCCEPose **仓库根**(`scripts/` 的上一级)。写入的目录名与 Hugging Face 数据集内一致,**不会**多一层 `SEU-WYL/HccePose`,例如:
|
| 20 |
+
|
| 21 |
+
| `--preset` | 仓库根下会出现 | 对应脚本/用法 |
|
| 22 |
+
|------------|----------------|---------------|
|
| 23 |
+
| `test` | `test_imgs/`、`test_videos/`、`test_imgs_RGBD/` | 单图 / 视频 / RGB-D 测试 |
|
| 24 |
+
| `dataset` | `demo-bin-picking/`(含 models、yolo11、HccePose 等) | `bop_dataset(..., 'demo-bin-picking')` |
|
| 25 |
+
| `tex` | `demo-tex-objs/` | 纹理物体 / 视频类 demo |
|
| 26 |
+
| `weights` | 仅 `demo-bin-picking/` 下 models、yolo11、HccePose | 已有其余目录时的轻量补全 |
|
| 27 |
+
|
| 28 |
+
因此:用脚本拉全所需 preset 后,目录布局应与「手工从网页下载并解压到仓库根」或维护者本机已就绪的环境**对齐**,`s4_p3_*.py` 里 `os.path.join(current_dir, 'test_imgs')`、`demo-bin-picking`、`test_imgs_RGBD` 等写法可直接使用(请在仓库根目录按 README 方式运行示例脚本)。
|
| 29 |
+
|
| 30 |
+
## 目录结构(快速开始与测试)
|
| 31 |
+
|
| 32 |
+
| 路径 | 说明 |
|
| 33 |
+
|------|------|
|
| 34 |
+
| `demo-bin-picking/` | BOP 格式示例场景:`models/`、`yolo11/`、`HccePose/` 权重等 |
|
| 35 |
+
| `demo-tex-objs/` | 另一套纹理物体示例(视频相关 demo) |
|
| 36 |
+
| `test_imgs/` | 单图快速开始用 RGB 图 |
|
| 37 |
+
| `test_videos/` | 视频示例 |
|
| 38 |
+
| `test_imgs_RGBD/` | RGB-D:`{stem}_rgb.png`、`_depth.png`、`_camK.json`(如 `000000`–`000003`) |
|
| 39 |
+
|
| 40 |
+
## RGB-D 约定
|
| 41 |
+
|
| 42 |
+
- **`camK.json`**:至少含 `fx, fy, cx, cy`(读取方式见 GitHub 上 `Refinement/refinement_test_utils.load_capture_frame`)。
|
| 43 |
+
- **深度图**:`uint16` PNG;转米单位与 `convert_depth_to_meter` 一致(按有效深度中位数推断缩放)。
|
| 44 |
+
|
| 45 |
+
## 批量下载(官网 / 国内镜像)
|
| 46 |
+
|
| 47 |
+
在 **GitHub 克隆的 HCCEPose 仓库根目录**执行:
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
python scripts/download_hf_assets.py --preset test --endpoint auto
|
| 51 |
+
python scripts/download_hf_assets.py --preset dataset --endpoint auto
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
`--endpoint auto` 先连官方,失败则尝试 `https://hf-mirror.com`。详见 `python scripts/download_hf_assets.py --help`。
|
| 55 |
+
|
| 56 |
+
## 许可
|
| 57 |
+
|
| 58 |
+
以 Hugging Face 数据集页所示为准;第三方权重(如 FoundationPose)遵循各自许可。
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
*English index (use as HF `README.md`): [README.md](README.md).*
|