Dataset Directory
This directory contains the dataset for LLRFormer keypoint detection model.
Directory Structure
data/
├── train/ # Training set
│ ├── images/ # Training images
│ └── annotations/ # Training annotations (JSON format)
├── val/ # Validation set
│ ├── images/ # Validation images
│ └── annotations/ # Validation annotations (JSON format)
├── test/ # Test set
│ ├── images/ # Test images
│ └── annotations/ # Test annotations (JSON format)
└── external/ # External dataset (optional)
└── external/
├── images/
└── annotations/
Data Format
Image Format
- Supported formats: JPEG (.jpeg, .jpg), PNG (.png)
- Color space: RGB (configured via
DATASET.COLOR_RGBin config) - Input size: Images will be resized and padded to 384×1152 (width×height)
Annotation Format
Annotations are stored in LabelMe JSON format. Each annotation file corresponds to one image file with the same base name.
JSON Structure
{
"version": "2.4.4",
"flags": {},
"shapes": [
{
"label": "R_FC",
"points": [[x1, y1], [x2, y2]], // For circle: center and edge point
"shape_type": "circle", // or "point"
...
},
...
],
"imagePath": "image_filename.jpeg",
"imageHeight": 8025,
"imageWidth": 2947
}
Keypoint Types
Point: Single point annotation (
shape_type: "point")points:[[x, y]]- keypoint coordinates
Circle: Circle annotation (
shape_type: "circle")points:[[cx, cy], [edge_x, edge_y]]- center and edge point- Note: Only the center point (
points[0]) is used for keypoint detection
Keypoint Labels
The model expects 36 keypoints in a specific order. Keypoint labels include:
- Hip region:
R_FC,L_FC,R_GT,L_GT,R_FNeck_Cut_Up,L_FNeck_Cut_Up,R_FNeck_Cut_Down,L_FNeck_Cut_Down - Femur region:
R_Cdy_Up,L_Cdy_Up,R_Cdy_Down,L_Cdy_Down - Knee region: Various knee-related keypoints
- Tibia region:
R_Cyd_Up,L_Cyd_Up,R_Cyd_Down,L_Cyd_Down - Ankle region:
R_DLP,L_DLP,R_DMP,L_DMP, etc.
Data Preparation
1. Organize Your Data
Place your images and annotations in the corresponding directories:
- Training images →
data/train/images/ - Training annotations →
data/train/annotations/ - Validation images →
data/val/images/ - Validation annotations →
data/val/annotations/
2. File Naming Convention
- Image and annotation files should have the same base name
- Example:
- Image:
1_2_410_200049_2_47176438882121_3_1_20180304081116139_77313.jpeg - Annotation:
1_2_410_200049_2_47176438882121_3_1_20180304081116139_77313.json
- Image:
3. Annotation Requirements
- Each annotation file must contain exactly 36 keypoints
- Keypoints can be annotated as
pointorcircleshapes - For circles, only the center point will be used
- Missing keypoints should be padded with
[0.0, 0.0]during evaluation
4. Image Preprocessing
The dataset loader automatically:
- Resizes images to fit within 384×1152 while maintaining aspect ratio
- Pads images to exactly 384×1152 (centered)
- Converts grayscale images to 3-channel RGB
- Applies color space conversion (BGR→RGB) if configured
Configuration
Set the following parameters in your config file (configs/llrformer.yaml):
DATASET:
DATASET: 'MyKeypointDataset' # Dataset class name
ROOT: 'data' # Root directory
TRAIN_SET: 'train' # Training set folder
TEST_SET: 'val' # Validation set folder
DATA_FORMAT: jpeg # Image format (jpeg, png, or auto)
COLOR_RGB: true # Use RGB color order
Dataset Statistics
- Training set: 709 images
- Validation set: 102 images
- Test set: 200 images
- External set: 136 images (optional)
Notes
Image Size: Original images can be any size. They will be automatically resized and padded to 384×1152 during loading.
Keypoint Order: The order of keypoints in the annotation file matters. Ensure consistency across all annotations.
Missing Keypoints: If a keypoint is missing in an annotation, it should be represented as
[0.0, 0.0]or omitted (will be padded during evaluation).External Dataset: The
external/folder contains additional data that may not follow the same structure. Adjust paths accordingly if using this data.Format Support: The dataset loader supports multiple image formats. Set
DATA_FORMAT: autoin config to automatically detect JPEG and PNG files.
Troubleshooting
Issue: Images not loading
- Check file paths and naming conventions
- Verify image format is supported (JPEG/PNG)
- Ensure annotation files exist for each image
Issue: Keypoint count mismatch
- Verify all annotations contain exactly 36 keypoints
- Check for missing or extra keypoints in annotation files
- Ensure keypoint order is consistent
Issue: Coordinate errors
- Verify coordinate system (origin at top-left)
- Check that coordinates are within image boundaries
- Ensure annotation format matches LabelMe JSON structure
- Downloads last month
- 7