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

Bv0.5.0 beta #325

Merged
merged 153 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
4123bb3
new: from directory dataset iterator
Data-Iab Aug 22, 2022
37036ba
optim path filter
Data-Iab Aug 22, 2022
065a2af
fix: typos
Data-Iab Aug 22, 2022
10f47f6
fixed function description
Nov 17, 2022
c2a7051
Append Labels on BoundingBoxes3D
Ardorax Nov 17, 2022
f8fa0ab
remove userwarning
Data-Iab Nov 17, 2022
f132542
revert
Data-Iab Nov 17, 2022
44bba05
remove userwarning
Data-Iab Nov 17, 2022
adc76e7
Merge branch 'alobugdays' of https://github.com/Visual-Behavior/aloce…
tflahaul Nov 17, 2022
651fb85
added usable test split
Nov 17, 2022
0a509f5
Merge pull request #246 from Visual-Behavior/warning
anhtu293 Nov 17, 2022
0477763
Append Labels on BoundingBoxes3D
Ardorax Nov 17, 2022
94f4e57
docstrings
Data-Iab Nov 17, 2022
e86a61d
refactor: var names
Data-Iab Nov 17, 2022
ecc48d5
Merge branch 'alobugdays' into custom_dataset
Data-Iab Nov 17, 2022
ae3bc33
Merge branch
Ardorax Nov 17, 2022
6be10be
Merge pull request #250 from Visual-Behavior/224-labels-on-boundingbo…
Data-Iab Nov 17, 2022
63c062f
Display label name instead of ID next to the bounding box
eleonorefrcs Nov 17, 2022
5e095a4
solved coding convention issues
Nov 17, 2022
e1549ec
Merge branch 'alobugdays' into 221-label-name
eleonorefrcs Nov 17, 2022
50a504b
Merge pull request #247 from Visual-Behavior/alobugdays-issue234
anhtu293 Nov 17, 2022
80080ba
add runtime errors for not optimized precisions
Data-Iab Nov 17, 2022
a762433
reduce max workstation size
Data-Iab Nov 17, 2022
76fa52b
Typo in BoundingBoxes2D
Ardorax Nov 17, 2022
92c1d5a
Merge pull request #254 from Visual-Behavior/221-label-name
Data-Iab Nov 17, 2022
413335d
Merge pull request #248 from Visual-Behavior/custom_dataset
Data-Iab Nov 17, 2022
43e0d3b
Aloception Logo
Ardorax Nov 17, 2022
418775a
refactor: max_work_size to params
Data-Iab Nov 17, 2022
5eee797
refactor : from error to warning
Data-Iab Nov 17, 2022
7b292ed
Merge pull request #255 from Visual-Behavior/boundingboxes2d_typo
Data-Iab Nov 17, 2022
ffbc525
Merge pull request #258 from Visual-Behavior/trt-warnings
anhtu293 Nov 17, 2022
a6c098c
White background
Ardorax Nov 17, 2022
036c689
Autodetermine Temporal position when calling .temporal()
ragier Nov 17, 2022
42c6001
Support pytorch 1.13
Nov 17, 2022
bba7c7f
Merge branch 'alobugdays' of github.com:Visual-Behavior/aloception-os…
Nov 17, 2022
9d17470
Official Logo
Ardorax Nov 17, 2022
1358b57
Merge pull request #263 from Visual-Behavior/15-spatialaugmentedtenso…
Data-Iab Nov 17, 2022
1816f66
added "training" or "testing" param
Nov 17, 2022
fab2c7b
accept already created sampler instance
jsalotti Nov 17, 2022
96995b3
accept sampler kwargs
jsalotti Nov 17, 2022
12c3a87
docstring
jsalotti Nov 17, 2022
121b3f2
Merge pull request #266 from Visual-Behavior/alobugdays_issue107
jsalotti Nov 17, 2022
7205308
supported norms check
tflahaul Nov 17, 2022
8d24390
set mean_std to resnet_rgb_mean_std when in resnet norm
tflahaul Nov 17, 2022
921bb98
Prevent None accumulation
Nov 17, 2022
feb811e
Merge pull request #270 from Visual-Behavior/thomas/frame-in-resnet-n…
Data-Iab Nov 17, 2022
f16022e
Merge pull request #268 from Visual-Behavior/267-saved-names-none
Data-Iab Nov 17, 2022
27bbb99
change vb_fodler to vb_folder
anhtu293 Nov 17, 2022
0e3f126
Add option to activate/deactivate black title square from views
eleonorefrcs Nov 17, 2022
902742b
Improve title on views
eleonorefrcs Nov 17, 2022
b942343
Merge branch 'alobugdays' into 12-black-square-title
eleonorefrcs Nov 17, 2022
16d318f
Merge pull request #273 from Visual-Behavior/issue271-vb_folder
Data-Iab Nov 17, 2022
d6b593f
kwargs to handle padding_mode & more
tflahaul Nov 17, 2022
00aaaf9
Multiple Labels
Ardorax Nov 17, 2022
f2f63bb
Merge pull request #276 from Visual-Behavior/thomas/aten-pad
Data-Iab Nov 17, 2022
ab51740
Add method to convert frame to uint8 numpy array
eleonorefrcs Nov 17, 2022
5527699
added warning message
Nov 17, 2022
b1ceee4
Better cls search
Nov 17, 2022
91d631b
wip
anhtu293 Nov 17, 2022
53e8e3a
Display multiple Labels
Ardorax Nov 18, 2022
85ed0f0
Fix camera_calibe to solve boxes 3d wrong display
FlorianCoissac Nov 18, 2022
336bce8
revert 22-kwargs-padding_mode-&-more
Data-Iab Nov 18, 2022
542973c
fix
ragier Nov 18, 2022
355aca6
Merge pull request #275 from Visual-Behavior/12-black-square-title
anhtu293 Nov 18, 2022
e92dcc2
Merge pull request #264 from Visual-Behavior/support-pytorch1-13
Data-Iab Nov 18, 2022
5f1526d
crowdhuman changes from review + coco coding style
Nov 17, 2022
7adb81c
fixed path
Nov 18, 2022
e17becd
fix aten pad + docstring
tflahaul Nov 18, 2022
3f2e982
add dynamic axes onnx option
Data-Iab Nov 18, 2022
b709f39
Kitti: Documentation
Ardorax Nov 18, 2022
b08494e
`torchvision.pad` keyword arguments
tflahaul Nov 18, 2022
9428e1f
[wip] adding split
Nov 18, 2022
5679747
Merge pull request #282 from Visual-Behavior/221-named-labels-on-boun…
Data-Iab Nov 18, 2022
aaa0dde
finished adding split
Nov 18, 2022
f44b117
Rename function to convert tensor to numpy array
eleonorefrcs Nov 18, 2022
460a163
Example
Ardorax Nov 18, 2022
a8f5bee
optional multiple argument
tflahaul Nov 18, 2022
2f0e71f
Merge pull request #288 from Visual-Behavior/286-kitti-datasets-missi…
Data-Iab Nov 18, 2022
a371440
offset values in cache
tflahaul Nov 18, 2022
46b7fdb
added center to rotate
Nov 18, 2022
b8e1a6c
fix
ragier Nov 18, 2022
637f104
Merge pull request #285 from Visual-Behavior/252-crowdhuman
Data-Iab Nov 18, 2022
88897e0
refactor
anhtu293 Nov 18, 2022
8ee0986
flexible onnx version
Data-Iab Nov 18, 2022
dafbd1e
Merge pull request #280 from Visual-Behavior/21-frame-to-numpy-array
Data-Iab Nov 18, 2022
9de516e
Merge pull request #279 from Visual-Behavior/52-detr_make_sh_message
Data-Iab Nov 18, 2022
9486365
version im args
Data-Iab Nov 18, 2022
d846bad
reaname
Data-Iab Nov 18, 2022
1c2849b
handle ANY multiple yeee
tflahaul Nov 18, 2022
ccf9260
Dubug code
Ardorax Nov 18, 2022
a55675b
Improve documentation in Renderer and View
eleonorefrcs Nov 18, 2022
7861d9a
Fix views_counter if None
eleonorefrcs Nov 18, 2022
b41a6e4
Remove useless imports
eleonorefrcs Nov 18, 2022
7df8b10
Merge pull request #297 from Visual-Behavior/221-named-labels-on-boun…
Data-Iab Nov 18, 2022
c095b09
Adapt text size to number of views
eleonorefrcs Nov 18, 2022
c04f0cc
White background
Ardorax Nov 18, 2022
331fff6
argument multiple of `.pad` unittest
tflahaul Nov 18, 2022
873cc58
😔😔
tflahaul Nov 18, 2022
b3035d5
detach tensors not used for backprop
Aurelien-VB Nov 18, 2022
4dd90fa
Merge pull request #292 from Visual-Behavior/thomas/pad-to-multiple
anhtu293 Nov 18, 2022
f0f2078
Merge pull request #294 from Visual-Behavior/17-recursive-cropping-of…
Data-Iab Nov 18, 2022
2b8df74
Merge pull request #289 from Visual-Behavior/thomas/fix-pad
anhtu293 Nov 18, 2022
9012988
added wandb hyperparams logging to pl helpers
Nov 18, 2022
21715b0
Fix index of element to get in tutorials
eleonorefrcs Nov 18, 2022
81cb495
commit
jsalotti Nov 18, 2022
fc1aa9e
Merge pull request #305 from Visual-Behavior/tutorials-get
Data-Iab Nov 21, 2022
d7870a8
fix cat for tuple of augmented tensor
jsalotti Nov 21, 2022
44e8d6f
fix the behavior for properties
jsalotti Nov 21, 2022
c315e46
fix non-mergeable children
jsalotti Nov 21, 2022
5f1e625
remove print and dead code
jsalotti Nov 21, 2022
e1d429a
comments
jsalotti Nov 21, 2022
81d2d2b
remove error for unmergeable children :
jsalotti Nov 21, 2022
3787391
Merge pull request #307 from Visual-Behavior/issue306_cat_augmentedte…
Data-Iab Nov 24, 2022
24b5ed3
Merge pull request #287 from Visual-Behavior/dynamic-onnx
Data-Iab Nov 25, 2022
20b718b
Merge branch 'alobugdays' into onnx_version
Data-Iab Nov 25, 2022
b362dfc
Merge pull request #295 from Visual-Behavior/onnx_version
Data-Iab Nov 25, 2022
9f6a362
removed alocat
Dee61298 Nov 28, 2022
0deebd3
Merge pull request #281 from Visual-Behavior/issue85-load_model
Data-Iab Dec 2, 2022
210f988
Fix camera calib to fix 3D boxes placement
FlorianCoissac Dec 2, 2022
4cd7df6
Merge branch '3DBoxes_placement_issue_FC' of github.com:Visual-Behavi…
FlorianCoissac Dec 2, 2022
d0654f8
Merge branch 'alobugdays' into 3DBoxes_placement_issue_FC
FlorianCoissac Dec 2, 2022
c847b0a
Merge pull request #265 from Visual-Behavior/ISSUE38_sintel_test
Data-Iab Dec 5, 2022
f686492
Merge pull request #299 from Visual-Behavior/16_detach_metrics
Data-Iab Dec 5, 2022
34832e9
Merge pull request #298 from Visual-Behavior/renderer-documentation
Data-Iab Dec 5, 2022
a68cce7
Aloception-OSS
Ardorax Dec 7, 2022
bf0d9d2
Merge pull request #259 from Visual-Behavior/257-aloception-logo
Data-Iab Dec 28, 2022
e1c3677
Merge pull request #293 from Visual-Behavior/290-add-center-argument-…
Data-Iab Jan 12, 2023
6a51940
Merge pull request #284 from Visual-Behavior/237-__getitem__Augmented…
Data-Iab Jan 12, 2023
1fa7302
Merge pull request #300 from Visual-Behavior/55-new
Data-Iab Jan 12, 2023
f6ba0f7
Merge pull request #309 from Visual-Behavior/3DBoxes_placement_issue_FC
Data-Iab Jan 12, 2023
f57ce7b
unittests
jsalotti Jan 16, 2023
6f451d2
fix condition
jsalotti Jan 16, 2023
2346eb9
unittest for old behavior
jsalotti Jan 16, 2023
996e665
Merge pull request #304 from Visual-Behavior/fix_merge_tensor_dict_child
Data-Iab Jan 16, 2023
1c6ad94
Merge branch 'dev' into alobugdays
Data-Iab Jan 17, 2023
b0bb057
dev : alobugs updates
Data-Iab Jan 17, 2023
7f3f7b8
feat -detr exportation- include preprocessing
Data-Iab Jan 20, 2023
e85a8eb
update readme
Data-Iab Jan 20, 2023
15d8c44
Docker pytorch 1.13
Feb 1, 2023
427b249
added sequential arg to data2detr + test
Feb 2, 2023
9c0215f
layers in order in detr and deformable detr
Feb 2, 2023
8a817ed
added spatial_shift to mask to shunt error message
Feb 2, 2023
e746cbf
hidden_dim param in decoder
Feb 2, 2023
bf5148b
arg order, typing, comments
Feb 9, 2023
c825fc5
Merge pull request #320 from Visual-Behavior/deformable2slam2
Data-Iab Feb 9, 2023
49ea8b5
separate tracing assertion
Data-Iab Feb 16, 2023
fbd9169
remove dim assert
Data-Iab Feb 16, 2023
469114d
Merge pull request #319 from Visual-Behavior/detr_pre
thibo73800 Feb 16, 2023
8ff0f36
Docker install
Feb 16, 2023
2e02a62
Merge branch 'dev' of github.com:Visual-Behavior/aloception-oss into …
Feb 16, 2023
9aabebe
Fixe p=0.5 on transform
Feb 16, 2023
2efae6f
Add image hub + update release
Feb 16, 2023
033f45c
Merge pull request #321 from Visual-Behavior/docker_torch1.13
thibo73800 Feb 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
# tagged aloception-oss:cuda-11.3.1-pytorch1.10.1-lightning1.4.1

FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
#FROM nvidia/cuda:11.6.0-cudnn8-devel-ubuntu20.04

ARG py=3.9
ARG pytorch=1.13.1
ARG torchvision=0.14.1
ARG torchaudio=0.13.1
ARG pytorch_lightning=1.9.0
ARG pycyda=11.7

ENV TZ=Europe/Paris
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y build-essential nano git wget libgl1-mesa-glx

# Usefull for scipy
RUN apt-get install -y gfortran
# required for aloscene
RUN apt-get install -y libglib2.0-0


RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
ENV PATH=$PATH:/miniconda/condabin:/miniconda/bin
RUN /bin/bash -c "source activate base"
ENV HOME /workspace
WORKDIR /workspace
RUN conda install python=3.9 pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 opencv=4.5.3 -c pytorch -c conda-forge
COPY requirements.txt /install/requirements.txt
RUN pip install -r /install/requirements.txt

# Pytorch & pytorch litning
RUN conda install pytorch==${pytorch} torchvision==${torchvision} torchaudio==${torchaudio} pytorch-cuda=${pycuda} -c pytorch -c nvidia
RUN pip install pytorch_lightning==${pytorch_lightning}

COPY requirements-torch1.13.1.txt /install/requirements-torch1.13.1.txt
RUN pip install -r /install/requirements-torch1.13.1.txt
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p align="center">
<img src="images/aloception.png" style="text-align:center; width: 50%;" alt="Logo aloception" />
<img src="images/aloception-oss.jpg" style="text-align:center; width: 50%;" alt="Logo aloception" />
</p>

<a href="https://visual-behavior.github.io/aloception-oss/">Documentation</a>

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-0.3.0-green.svg)](https://conventionalcommits.org)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-0.5.0-green.svg)](https://conventionalcommits.org)

# Aloception open source software

Expand Down Expand Up @@ -75,6 +75,26 @@ training pipelines with **augmented tensors**.

## Installation

### Docker install

```
docker build -t aloception-oss:cuda-11.3.1-pytorch1.13.1-lightning1.9.0 .
```

```
docker run --gpus all -it -v /YOUR/WORKSPACE/:/workspace --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix aloception-oss:cuda-11.3.1-pytorch1.13.1-lightning1.9.0
```

Or without building the image

```
docker run --gpus all -it -v /YOUR/WORKSPACE/:/workspace --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix visualbehaviorofficial/aloception-oss:cuda-11.3.1-pytorch1.13.1-lightning1.9.0
```



### Pip install

You first need to install PyTorch 1.10.1 based on your hardware and environment
configuration. Please refer to the [pytorch website](https://pytorch.org/get-started/locally/) for this installation.

Expand All @@ -90,7 +110,7 @@ Alternatively, you can clone the repository and use:
pip install -e aloception-oss/
```

Or setup the repo yourself in your env and install the dependencies
Or setup the repo yourself in your env and install the dependencies

```sh
pip install -r requirements.txt
Expand Down
1 change: 1 addition & 0 deletions alodataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
from .sintel_flow_dataset import SintelFlowDataset
from .sintel_disparity_dataset import SintelDisparityDataset
from .sintel_multi_dataset import SintelMultiDataset
from .from_directory_dataset import FromDirectoryDataset
from .woodScape_dataset import WooodScapeDataset
from .woodScape_split_dataset import WoodScapeSplitDataset
11 changes: 6 additions & 5 deletions alodataset/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def stream_loader(dataset, num_workers=2):
return data_loader


def train_loader(dataset, batch_size=1, num_workers=2, sampler=torch.utils.data.RandomSampler):
def train_loader(dataset, batch_size=1, num_workers=2, sampler=torch.utils.data.RandomSampler, sampler_kwargs={}):
"""Get training loader from the dataset

Parameters
Expand All @@ -69,14 +69,15 @@ def train_loader(dataset, batch_size=1, num_workers=2, sampler=torch.utils.data.
Number of workers, by default 2
sampler : torch.utils.data, optional
Callback to sampler the dataset, by default torch.utils.data.RandomSampler
Or instance of any class inheriting from torch.utils.data.Sampler

Returns
-------
torch.utils.data.DataLoader
A generator
"""
sampler = sampler(dataset) if sampler is not None else None

if sampler is not None and not(isinstance(sampler, torch.utils.data.Sampler)):
sampler = sampler(dataset, **sampler_kwargs)
data_loader = torch.utils.data.DataLoader(
dataset,
# batch_sampler=batch_sampler,
Expand Down Expand Up @@ -332,7 +333,7 @@ def stream_loader(self, num_workers=2):
"""
return stream_loader(self, num_workers=num_workers)

def train_loader(self, batch_size=1, num_workers=2, sampler=torch.utils.data.RandomSampler):
def train_loader(self, batch_size=1, num_workers=2, sampler=torch.utils.data.RandomSampler, sampler_kwargs={}):
"""Get training loader from the dataset

Parameters
Expand All @@ -351,7 +352,7 @@ def train_loader(self, batch_size=1, num_workers=2, sampler=torch.utils.data.Ran
torch.utils.data.DataLoader
A generator
"""
return train_loader(self, batch_size=batch_size, num_workers=num_workers, sampler=sampler)
return train_loader(self, batch_size=batch_size, num_workers=num_workers, sampler=sampler, sampler_kwargs=sampler_kwargs )

def prepare(self):
"""Prepare the dataset. Not all child class need to implement this method.
Expand Down
27 changes: 23 additions & 4 deletions alodataset/coco_base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import os
import numpy as np
import torch

from alodataset import BaseDataset
from aloscene import BoundingBoxes2D, Frame, Labels, Mask
from collections import defaultdict
from pathlib import Path
from pycocotools import mask as coco_mask
from pycocotools.coco import COCO
from typing import Dict, Union

from alodataset import BaseDataset
from aloscene import BoundingBoxes2D, Frame, Labels, Mask


class CocoBaseDataset(BaseDataset):
Expand Down Expand Up @@ -78,10 +80,17 @@ def __init__(
return
else:
assert img_folder is not None, "When sample = False, img_folder must be given."
assert ann_file is not None, "When sample = False, ann_file must be given."
assert ann_file is not None or "test" in img_folder, "When sample = False and the test split is not used, ann_file must be given."


# Create properties
self.img_folder = os.path.join(self.dataset_dir, img_folder)

if "test" in img_folder:
#get a list of indices that don't rely on the annotation file
self.items = [int(Path(os.path.join(self.img_folder, f)).stem) for f in os.listdir(self.img_folder) if os.path.isfile(os.path.join(self.img_folder, f))]
return

self.coco = COCO(os.path.join(self.dataset_dir, ann_file))
self.items = list(sorted(self.coco.imgs.keys()))

Expand Down Expand Up @@ -231,7 +240,12 @@ def getitem(self, idx):
return BaseDataset.__getitem__(self, idx)

image_id = self.items[idx]
if "test" in self.img_folder:
#get the filename from image_id without relying on annotation file
return Frame(os.path.join(self.img_folder, f"{str(image_id).zfill(12)}.jpg"))

frame = Frame(os.path.join(self.img_folder, self.coco.loadImgs(image_id)[0]["file_name"]))

target = self.coco.loadAnns(self.coco.getAnnIds(image_id))
target = {"image_id": image_id, "annotations": target}
_, target = self.prepare(frame, target)
Expand Down Expand Up @@ -341,7 +355,12 @@ def __call__(self, image, target):


if __name__ == "__main__":
coco_dataset = CocoBaseDataset(sample=True)
coco_dataset = CocoBaseDataset(sample=False, img_folder="test2017")
#checking if regular getitem works
frame = coco_dataset[0]
frame.get_view().render()

#check if dataloader works
for f, frames in enumerate(coco_dataset.train_loader(batch_size=2)):
frames = Frame.batch_list(frames)
frames.get_view().render()
Expand Down
27 changes: 24 additions & 3 deletions alodataset/crowd_human_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ def __init__(
return
else:
assert img_folder is not None, "When sample = False, img_folder must be given."
assert ann_file is not None, "When sample = False, ann_file must be given."
assert ann_file is not None or "test" in img_folder, "When sample = False and the test split is not used, ann_file must be given."

if "test" in img_folder:
self._img_folder = img_folder
self.img_folder = os.path.join(self.dataset_dir, img_folder, "images_test")

self.items = []
for f in os.listdir(self.img_folder):
if os.path.isfile(os.path.join(self.img_folder, f)):
self.items.append({"ID": Path(os.path.join(self.img_folder, f)).stem})

return

assert type(img_folder) == type(ann_file), "img_folder & ann_file must be the same type."

Expand Down Expand Up @@ -121,9 +132,14 @@ def getitem(self, idx):
return BaseDataset.__getitem__(self, idx)

record = self.items[idx]
ann_id = record["ann_id"]
image_id = record["ID"]

if "test" in self.img_folder:
#get the filename from image_id without relying on annotation file
return Frame(os.path.join(self.img_folder, image_id + ".jpg"))

ann_id = record["ann_id"]

image_path = os.path.join(self.img_folder[ann_id], image_id + ".jpg")

frame = Frame(image_path)
Expand Down Expand Up @@ -272,6 +288,9 @@ def prepare(self):
if self.sample is not None and self.sample is not False: # Nothing to do. Samples are ready
return

if "test" in self.img_folder:
return #The code for preparing test datasets exist but we are not doing that now

if self.dataset_dir.endswith("_prepared") and not os.path.exists(self.dataset_dir.replace("_prepared", "")):
return

Expand All @@ -294,7 +313,9 @@ def prepare(self):

def main():
"""Main"""
crowd_human_dataset = CrowdHumanDataset(img_folder="CrowdHuman_train", ann_file="annotation_train.odgt")
crowd_human_dataset = CrowdHumanDataset(img_folder="CrowdHuman_test")
stuff = crowd_human_dataset[0]
stuff.get_view().render()

crowd_human_dataset.prepare()
for i, frames in enumerate(crowd_human_dataset.train_loader(batch_size=2, sampler=None, num_workers=0)):
Expand Down
Loading