Dataset Viewer
The dataset could not be loaded because the splits use different data file formats, which is not supported. Read more about the splits configuration. Click for more details.
Couldn't infer the same data file format for all splits. Got {NamedSplit('train'): (None, {}), NamedSplit('test'): ('imagefolder', {})}
Error code:   FileFormatMismatchBetweenSplitsError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

HccePose (BF) Dataset

This repository contains the dataset and resources associated with the paper HccePose(BF): Predicting Front & Back Surfaces to Construct Ultra-Dense 2D-3D Correspondences for Pose Estimation.

Code: https://github.com/WangYuLin-SEU/HCCEPose

arXiv HuggingFace

🧩 Introduction

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.

In the pose estimation process, the network trained with HCCE predicts the 3D surface coordinates of the object from a single RGB image, which are then used in a Perspective-n-Point (PnP) algorithm to solve for the 6D pose. Unlike traditional methods that only learn the visible front surface of objects, HccePose(BF) additionally learns the 3D coordinates of the back surface, thereby constructing denser 2D–3D correspondences and significantly improving pose estimation accuracy.

It is noteworthy that HccePose(BF) not only achieves high-precision 6D pose estimation but also delivers state-of-the-art performance in 2D segmentation from a single RGB image. The continuous and hierarchical nature of HCCE enhances the network’s ability to learn accurate object masks, offering substantial advantages over existing methods.

πŸš€ Features

πŸ”Ή Object Preprocessing

  • Object renaming and centering
  • Rotation symmetry calibration (8 symmetry types) based on KASAL
  • Export to BOP format

πŸ”Ή Training Data Preparation

  • Synthetic data generation and rendering using BlenderProc

πŸ”Ή 2D Detection

  • Label generation and model training using Ultralytics

πŸ”Ή 6D Pose Estimation

  • Preparation of front and back surface 3D coordinate labels
  • Distributed training (DDP) implementation of HccePose
  • Testing and visualization via Dataloader
  • HccePose (YOLOv11) inference and visualization on:
    • Single RGB images
    • RGB videos

✏️ Quick Start

This project provides a simple HccePose-based application example for the Bin-Picking task.
To reduce reproduction difficulty, both the objects (3D printed with standard white PLA material) and the camera (Xiaomi smartphone) are easily accessible devices.

You can:

  • Print the sample object multiple times
  • Randomly place the printed objects
  • Capture photos freely using your phone
  • Directly perform 2D detection, 2D segmentation, and 6D pose estimation using the pretrained weights provided in this project

πŸ“¦ Example Files

Please keep the folder hierarchy unchanged.

Type Resource Link
🎨 Object 3D Models models
πŸ“ YOLOv11 Weights yolo11
πŸ“‚ HccePose Weights HccePose
πŸ–ΌοΈ Test Images test_imgs
πŸŽ₯ Test Videos test_videos

⚠️ Note:
Files beginning with train_ are only required for training.
For this Quick Start section, only the above test files are needed.


πŸ“Έ Sample Usage

This example demonstrates how to perform 6D pose estimation using the provided pretrained weights and an example image from this repository.

First, ensure you have the required environment set up as described in the GitHub repository's Environment Setup section.

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.

Example input image πŸ‘‡

Source image: Example Link

import cv2
import numpy as np
from HccePose.tester import Tester
from HccePose.bop_loader import bop_dataset
import os

if __name__ == '__main__':
    # Adjust this path to where you have cloned/downloaded the Hugging Face dataset repository.
    # For example, if you cloned the repo to './HccePose', then:
    base_repo_path = '.' # Assuming script is run from the root of the cloned HF repo
    
    dataset_path = os.path.join(base_repo_path, 'demo-bin-picking')
    bop_dataset_item = bop_dataset(dataset_path)

    CUDA_DEVICE = '0' # Specify your CUDA device if available, 'cpu' otherwise
    show_op = True    # Set to True to display visualizations
    
    Tester_item = Tester(bop_dataset_item, show_op=show_op, CUDA_DEVICE=CUDA_DEVICE)
    
    obj_id = 1
    image_name = 'IMG_20251007_165718'
    image_file_path = os.path.join(base_repo_path, 'test_imgs', f'{image_name}.jpg')

    if not os.path.exists(image_file_path):
        print(f"Error: Image file not found at {image_file_path}. Please ensure the HF dataset is downloaded correctly.")
    else:
        image = cv2.cvtColor(cv2.imread(image_file_path), cv2.COLOR_RGB2BGR)
        
        # Example camera intrinsics (from GitHub README)
        cam_K = np.array([
            [2.83925618e+03, 0.00000000e+00, 2.02288638e+03],
            [0.00000000e+00, 2.84037288e+03, 1.53940473e+03],
            [0.00000000e+00, 0.00000000e+00, 1.00000000e+00],
        ])
        
        results_dict = Tester_item.perdict(cam_K, image, [obj_id],
                                                        conf=0.85, confidence_threshold=0.85)
        
        # Save visualization results to an 'output_results' directory
        output_dir = './output_results'
        os.makedirs(output_dir, exist_ok=True)
        cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_2d.jpg'), results_dict['show_2D_results'])
        cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_6d_vis0.jpg'), results_dict['show_6D_vis0'])
        cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_6d_vis1.jpg'), results_dict['show_6D_vis1'])
        cv2.imwrite(os.path.join(output_dir, f'{image_name}_show_6d_vis2.jpg'), results_dict['show_6D_vis2'])
        print(f"Results saved to {output_dir}")

🎯 Visualization Results

2D Detection Result (_show_2d.jpg):


Network Outputs:

  • HCCE-based front and back surface coordinate encodings

  • Object mask

  • Decoded 3D coordinate visualizations


Downloads last month
1,175