eg3d icon indicating copy to clipboard operation
eg3d copied to clipboard

Question for label

Open wyiguanw opened this issue 2 years ago • 4 comments

Hello I have a problem when I using the dataset_tool for prepare datasets both from you provided and mine own. There is no label in dataset.json only ["label"] . Can anyone give me some instruction? Thank you!

wyiguanw avatar Jul 07 '22 15:07 wyiguanw

Hi, the dataset.json file for EG3D is formatted as follows:

{
    "labels": [
        [path/to/image_name_0, 25-length label],
        [path/to/image_name_1, 25-length label],
        ...
        [path/to/image_name_2, 25-length label],
    ]
}

where every 25-length label is [flattened 4x4 camera pose matrix concatenated to flattened 3x3 intrinsics matrix] corresponding to the image

As such, we expect the only top-level key to be 'label' as you observed. A simple sample to iterate the dataset.json is as follows:

import json
with open('dataset.json') as f:
    dataset = json.load(f)

for path, label in dataset['labels']:
    # do something with path and label

matthew-a-chan avatar Jul 08 '22 17:07 matthew-a-chan

Hi, the dataset.json file for EG3D is formatted as follows:

{
    "labels": [
        [path/to/image_name_0, 25-length label],
        [path/to/image_name_1, 25-length label],
        ...
        [path/to/image_name_2, 25-length label],
    ]
}

where every 25-length label is [flattened 4x4 camera pose matrix concatenated to flattened 3x3 intrinsics matrix] corresponding to the image

As such, we expect the only top-level key to be 'label' as you observed. A simple sample to iterate the dataset.json is as follows:

import json
with open('dataset.json') as f:
    dataset = json.load(f)

for path, label in dataset['labels']:
    # do something with path and label

Hello, I really appreciate your reply and I still have questions on generate data.json. When I try to use the dataset_tool to convert the data.json there is no 25-length label. Should I write the code to convert it? And what is the rule of those label to 25-length? Could you give me some instruction thank you.

wyiguanw avatar Jul 13 '22 17:07 wyiguanw

Hi, the dataset.json file for EG3D is formatted as follows:

{
    "labels": [
        [path/to/image_name_0, 25-length label],
        [path/to/image_name_1, 25-length label],
        ...
        [path/to/image_name_2, 25-length label],
    ]
}

where every 25-length label is [flattened 4x4 camera pose matrix concatenated to flattened 3x3 intrinsics matrix] corresponding to the image As such, we expect the only top-level key to be 'label' as you observed. A simple sample to iterate the dataset.json is as follows:

import json
with open('dataset.json') as f:
    dataset = json.load(f)

for path, label in dataset['labels']:
    # do something with path and label

Hello, I really appreciate your reply and I still have questions on generate data.json. When I try to use the dataset_tool to convert the data.json there is no 25-length label. Should I write the code to convert it? And what is the rule of those label to 25-length? Could you give me some instruction thank you.

were you able to solve this?

kashishnaqvi101 avatar Jun 28 '23 15:06 kashishnaqvi101