8000 question about fly_body data · Issue #14 · orhir/PoseAnything · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
question about fly_body data #14
Open
@binxlin

Description

@binxlin

Hello, I noticed some issues when observing the fly_body dataset. For example, when I was looking at fly_body/0.jpg and visualized the corresponding points from the annotation file you provided, I got incorrect results. I would like to ask how you processed the fly_body dataset? Below is my code for converting the .h5 file from Vinegar Fly to .jpg. Is there an error in my conversion, or does the fly_body dataset have annotation errors in mp100_split1_val.json ? If it's my conversion error, please tell me how to correctly convert. Thank you!
The first picture is I use the mp100_split1_val.json annotation attribute visualize the fly_body/0.jpg and got the keypoint positions:
Image

And the second picture is I use the .h5 first annotation attribute visualize the 0.jpg and got the keypoint positions:

Image

import h5py
import cv2
import numpy as np
import os
output_dir = "fly_extracted_images"
if not os.path.exists(output_dir):
os.makedirs(output_dir)
h5_file_path = "annotation_data_release.h5"
with h5py.File(h5_file_path, 'r') as h5f:
if 'images' in h5f:
images_dataset = h5f['images']
num_images = images_dataset.shape[0]
print(f"Found {num_images} images in the dataset")
print(f"Image dataset shape: {images_dataset.shape}")
for i in range(num_images):
img_arr = images_dataset[i, :]
if img_arr.max() <= 1.0:
img_arr = (img_arr * 255).astype(np.uint8)
print("Normalization successful")
output_path = os.path.join(output_dir, f"{i}.jpg")
cv2.imwrite(output_path, img_arr)
print(f"Saved image {i+1}/{num_images}")
else:
print("Could not find 'images' dataset. Available datasets are:")
for key in h5f.keys():
print(f"- {key}")
print("Conversion complete!")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0