Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gt_bboxes_2d = info['gt_boxes_2d'][mask] #11

Closed
sidiangongyuan opened this issue Jun 3, 2024 · 17 comments
Closed

gt_bboxes_2d = info['gt_boxes_2d'][mask] #11

sidiangongyuan opened this issue Jun 3, 2024 · 17 comments

Comments

@sidiangongyuan
Copy link

In nuscenes_dataset.py
# NOTE load image annotations
gt_bboxes_2d = info['gt_boxes_2d'][mask]
gt_labels_2d = gt_labels_3d.copy()

KeyError: 'gt_boxes_2d'.

what's wrong ?

@yinjunbo
Copy link
Owner

yinjunbo commented Jun 3, 2024

Hi, please follow the code in AutoAlignV2 exactly for generting the train/val infos.

@sidiangongyuan
Copy link
Author

image

Here is my data structure, is there any problem?

I just run python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes

The extra content is generated by other tasks and should not affect .

@yinjunbo
Copy link
Owner

yinjunbo commented Jun 6, 2024

Hi, thanks for your interest.
If you've re-generated the infos from AutoAlignV2,
'gt_boxes_2d' should have been contained in the infos, according to

info['gt_boxes_2d'] = np.array(gt_boxes_2d)

@sidiangongyuan
Copy link
Author

python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes
will not generate train and val .pkl , it just generate test.pkl.

and do I need to uncomment this?
image

@yinjunbo
Copy link
Owner

yinjunbo commented Jun 7, 2024

Hi, you can uncomment this

train_version = f'{args.version}-trainval'
to geenrate train&val infos.

@sidiangongyuan
Copy link
Author

Yes I found that.

And do I need to uncomment codes I show before ?

image

@yinjunbo
Copy link
Owner

yinjunbo commented Jun 7, 2024

No need. But please remember to back up your previous infos to avoid it being overwritten by the new ones.

@sidiangongyuan
Copy link
Author

OK, thank you for your help .

@yinjunbo yinjunbo closed this as completed Jun 7, 2024
@sidiangongyuan
Copy link
Author

No need. But please remember to back up your previous infos to avoid it being overwritten by the new ones.

Sorry, I encountered a problem again, when I generated the pkl of train and val,

FileNotFoundError: NuScenesDataset: [Errno 2] No such file or directory: './data/nuscenes/nuscenes_infos_trainval.pkl'

def nuscenes_data_prep(root_path,
info_prefix,
version,
dataset_name,
out_dir,
max_sweeps=10):
"""Prepare data related to nuScenes dataset.

Related data consists of '.pkl' files recording basic infos,
2D annotations and groundtruth database.

Args:
    root_path (str): Path of dataset root.
    info_prefix (str): The prefix of info filenames.
    version (str): Dataset version.
    dataset_name (str): The dataset class name.
    out_dir (str): Output directory of the groundtruth database info.
    max_sweeps (int): Number of input consecutive frames. Default: 10
"""
nuscenes_converter.create_nuscenes_infos(
    root_path, info_prefix, version=version, max_sweeps=max_sweeps)

if version == 'v1.0-test':
    info_test_path = osp.join(root_path, f'{info_prefix}_infos_test.pkl')
    nuscenes_converter.export_2d_annotation(
        root_path, info_test_path, version=version)
    return

info_train_path = osp.join(root_path, f'{info_prefix}_infos_train.pkl')
info_val_path = osp.join(root_path, f'{info_prefix}_infos_val.pkl')

# nuscenes_converter.export_2d_annotation(
#     root_path, info_train_path, version=version)
# nuscenes_converter.export_2d_annotation(
#     root_path, info_val_path, version=version)

create_groundtruth_database(dataset_name, root_path, info_prefix,
                            f'{out_dir}/{info_prefix}_infos_trainval.pkl',
                            with_bbox=True)

I need to confirm again, is the initial structure of the file like mine?
image

@yinjunbo
Copy link
Owner

yinjunbo commented Jun 7, 2024

Yes, the original files are like what you've showed. You can use the updated code to avoid the problem: https://github.com/yinjunbo/IS-Fusion/blob/167dc78de50da583a87597d57791f3dcbca91e9b/tools/create_data.py#L83C33-L83C76

@sidiangongyuan
Copy link
Author

Thank you for your patient answer, I have solved the problem

@loserhou
Copy link

Thank you for your patient answer, I have solved the problem
请问现在是直接使用作者这个命令就可以了吗,还需要去[AutoAlignV2]生成吗?

@sidiangongyuan
Copy link
Author

Thank you for your patient answer, I have solved the problem
请问现在是直接使用作者这个命令就可以了吗,还需要去[AutoAlignV2]生成吗?

是的

@loserhou
Copy link

loserhou commented Jul 24, 2024 via email

@xqk666
Copy link

xqk666 commented Sep 1, 2024

Hello, I encountered the same error when using the nuscenes mini dataset. I tried the above method but it didn't work. How can I fix it?

@sidiangongyuan
Copy link
Author

Hello, I encountered the same error when using the nuscenes mini dataset. I tried the above method but it didn't work. How can I fix it?

我这里并没有使用 mini。使用的是完整的数据集。
在生成数据的时候, train_version = f'{args.version}-trainval' 有mini的选项吧?

@BarryGustin
Copy link

Hello, when running the command "python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes", will there be any images without mask?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants