2024-02-29 13:39:11 +00:00
|
|
|
from pathlib import Path
|
2021-05-20 20:20:48 +00:00
|
|
|
import pandas as pd
|
|
|
|
import os
|
|
|
|
|
|
|
|
from .version import Version
|
|
|
|
from .base import BaseDataset
|
|
|
|
from .info import DatasetInfo
|
|
|
|
from . import constants as C
|
|
|
|
|
|
|
|
|
|
|
|
def get_dataset(split="train"):
|
2024-02-29 13:39:11 +00:00
|
|
|
data_dir = Path(__file__).parent.parent.parent / "data"
|
|
|
|
# here = os.path.dirname(__path__)
|
|
|
|
# data_dir = here + '/../../data/'
|
|
|
|
|
|
|
|
meta = pd.read_csv(data_dir / "non-empty-meta.csv")
|
|
|
|
info = DatasetInfo.load(data_dir / "info.yaml")
|
|
|
|
|
|
|
|
# meta['image_path'] = [f'data/image/{panoid}_{heading}.jpg' for panoid, heading in zip(meta['panoid'], meta['heading'])]
|
|
|
|
|
2024-04-17 13:38:30 +00:00
|
|
|
ds = BaseDataset(info, meta)
|
|
|
|
if split:
|
|
|
|
return ds[split]
|
|
|
|
else:
|
|
|
|
return ds
|
|
|
|
|