Coder Social home page Coder Social logo

sekilab / vehiclereidentificationdataset Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 1.26 MB

Vehicle Re-Identification (ReID) dataset contains over 55,000 images for training and validation of the vehicle re-identification model

License: Apache License 2.0

Jupyter Notebook 97.57% Shell 2.43%
carla-driving-simulator osnet reid reidentification vehicle-detection-and-tracking vehicle-reid vehicle-reidentification vehicle-tracking vehicle-trajectory yolo

vehiclereidentificationdataset's Introduction

Vehicle Re-Identification (ReID) Dataset

Sample images from the CARLA ReID dataset, resized to the same dimension for visualization. Figure on the left shows the variation of vehicle models and colors in the CARLA ReID dataset. CARLA ReID dataset contains four classes of vehicles such as car, truck, motorcycle, and bicycle. Figure on the right shows the camera angle variation for observing the same vehicle. Each vehicle is observed by 85 cameras located at varying distances surrounding the target vehicle.

  • The file names contain the information on vehicle id and camera id separated by an underscore, necessary to train ReID model.

    • If the filename is 20220711212617_24_9.jpg, then 20220711212617 is the datetime, 24 is the camera id and 9 represents the vehicle id. These two information is enough for training a ReID model

Download links

The download URL of the VeRi dataset is shown here. Please note that training, gallery and query images are all inside the same zip file.

Download VeRi dataset (CARLA)

Training example and Installation

  • Please check training_vehicle_reid.ipynb Jupyter notebook to train the model or understand the training process, in general.

Installation

  • Make sure that you have conda installed. Let's create a new virtual environment carla_reid with Python verison 3.7 by executing the following command:
conda create -n carla_reid python=3.7 pip pandas  -y
  • The above command, however, will not install torchreid. Also, pip package does not support latest build of torchreid and it needs to built from the source. I have provided bash script to simplify this task

  • First of all, activate the environment created before by executing the following command:

conda activate carla_reid
  • Make sure that the environment is activated and you are in the root directory of this repository. It should show (carla_reid) on the left of your username in the terminal. Run the following command:
bash install_packages_reid.sh
  • The above command will install torchreid 1.4.0 along with dependencies such as torch, torchvision, etc. You are all set to run the Jupyter notebook.

Citations

If you find our dataset useful and use it in your research, please give us a star โญ and cite the following article:

@INPROCEEDINGS{10020814,
  author={Kumar, Ashutosh and Kashiyama, Takehiro and Maeda, Hiroya and Zhang, Fan and Omata, Hiroshi and Sekimoto, Yoshihide},
  booktitle={2022 IEEE International Conference on Big Data (Big Data)}, 
  title={Vehicle re-identification and trajectory reconstruction using multiple moving cameras in the CARLA driving simulator}, 
  year={2022},
  volume={},
  number={},
  pages={1858-1865},
  doi={10.1109/BigData55660.2022.10020814}}
@article{kumar2022vehicle,
  title={Vehicle re-identification and trajectory reconstruction using multiple moving cameras in the CARLA driving simulator},
  author={Kumar, Ashutosh and Kashiyama, Takehiro and Maeda, Hiroya and Zhang, Fan and Omata, Hiroshi and Sekimoto, Yoshihide},
  year={2022},
  publisher={TechRxiv}
}

vehiclereidentificationdataset's People

Contributors

ashutoshiitk avatar homata avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vehiclereidentificationdataset's Issues

datamanager exits with KeyError: 3

Thanks for the dataset, it's a good intro data into getting started with Re-ID.
However, i've encountered an issue while following the instructions xD

# You can change these hyperparameters as you wish
datamanager = torchreid.data.ImageDataManager(

    root='',
    sources='synthtetic_veri_reid',
    height = 256,
    width = 256,
    transforms =['random_flip', 'random_crop'])

The above block raises a KeyError: 3 from class VeRiDataset car_id = label_dict[int(image.split('.jpg')[0].split('_')[-1])]

Is it that the dictionary isn't getting assigned the required key from that split operation ?

Also, the torchreid instructions don't have the root empty as per the custom dataset example

torchreid module wasn't in the condamdx_reid.yml for which i've installed torchreid==0.2.5 through pip

I suppose the error is from the split logic or is there anything else that might be causing it ?
path_to_dataset is pointing to the directory that contains the three data folders of gallery, query and train.

attaching the full trace-back below for reference:
##############################################################################

Building train transforms ...

  • resize to 256x256
  • random flip
  • random crop (enlarge to 288x288 and crop 256x256)
  • to torch tensor of range [0, 1]
  • normalization (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    Building test transforms ...
  • resize to 256x256
  • to torch tensor of range [0, 1]
  • normalization (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    => Loading train (source) dataset

KeyError Traceback (most recent call last)
Input In [7], in <cell line: 2>()
1 # You can change these hyperparameters as you wish
----> 2 datamanager = torchreid.data.ImageDataManager(
3 root='reid-data',
4 sources='synthtetic_veri_reid',
5 height = 256,
6 width = 256,
7 transforms =['random_flip', 'random_crop'])

File ~/anaconda3/envs/mdx_reid/lib/python3.9/site-packages/torchreid/data/datamanager.py:195, in ImageDataManager.init(self, root, sources, targets, height, width, transforms, k_tfm, norm_mean, norm_std, use_gpu, split_id, combineall, load_train_targets, batch_size_train, batch_size_test, workers, num_instances, num_cams, num_datasets, train_sampler, train_sampler_t, cuhk03_labeled, cuhk03_classic_split, market1501_500k)
193 trainset = []
194 for name in self.sources:
--> 195 trainset_ = init_image_dataset(
196 name,
197 transform=self.transform_tr,
198 k_tfm=k_tfm,
199 mode='train',
200 combineall=combineall,
201 root=root,
202 split_id=split_id,
203 cuhk03_labeled=cuhk03_labeled,
204 cuhk03_classic_split=cuhk03_classic_split,
205 market1501_500k=market1501_500k
206 )
207 trainset.append(trainset_)
208 trainset = sum(trainset)

File ~/anaconda3/envs/mdx_reid/lib/python3.9/site-packages/torchreid/data/datasets/init.py:42, in init_image_dataset(name, **kwargs)
37 if name not in avai_datasets:
38 raise ValueError(
39 'Invalid dataset name. Received "{}", '
40 'but expected to be one of {}'.format(name, avai_datasets)
41 )
---> 42 return __image_datasetsname

Input In [4], in VeRiDataset.init(self, root, **kwargs)
46 for image in IMAGES:
47 cam_id = int(image.split('.jpg')[0].split('')[-2])
---> 48 car_id = label_dict[int(image.split('.jpg')[0].split('
')[-1])]
49 query_array.append((FOLDER_PATH + dataset_type + "/" + image, car_id, cam_id))
52 train = training_array

KeyError: 3

##############################################################################

Thank you !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.