v0.5.0
- Fix bug #243 :
AugTensors can be called without logging the Userwarning
Add the 'append_labels' method to 'BoundingBoxes3D'.
- New feature 1 : Description
box3d = BoundingBoxes3D([[10, 10, 400, 80, 46, 18, 1]])
box3d.append_labels(label)
When labels names exist, display it next to the 2D bounding box instead of displaying IDs.
- New feature : #249 Dataset from directory iterator. Main use : calibrating TRT engines.
path1 = "PATH/TO/DIR/WITH/IMAGES1"
path2 = "PATH/TO/DIR/WITH/IMAGES2"
dataset = FromDirectoryDataset(dirs={"right": [path1, path1], "left": [path2, path2]}, slice=[0.2, 0.3])
# Will return dictionary {"right": img1, "left": img2}
sample1 = dataset[0]
- Fix bug #256 :
- Reduce the memory size required to export and run TRT engines.
- Raise runtime error when a precision is not optimized in a device.
- Fix bug : #15
>>frame = aloscene.Frame(np.random.uniform(0, 1, (3, 50, 100)), names=("C", "H", "W"))
>>frame = aloscene.Frame.batch_list([frame, frame.clone()])
>>frame = frame.temporal()
>>print(f"names: {frame.names}\nshape: {frame.shape}")
names: ('B', 'T', 'C', 'H', 'W')
shape: torch.Size([2, 1, 3, 50, 100])
- New feature 1 : Sampler for train loader can be constructed before calling the method
sampler = torch.utils.data.RandomSampler(dataset, replacement=True)
loader = dataset.train_loader(sampler=sampler)
- New feature 2 : Sampler kwargs can be given to
train_loader
method:
sampler = torch.utils.data.RandomSampler
loader = dataset.train_loader(sampler=sampler, sampler_kwargs={"replacement":True})
- Check if the requested normalization is supported
- Set the
mean_std
property toresnet_rgb_mean_std
at instantiation when usingnormalization="resnet"
- New feature 1 :
When manipulating aug tensor, _saved_names can accumulate None values which could prevent proper concatenation. Note that this might not be an issue once we have a good merging policy of different properties within aug tensors.
- ***Fix bug #271 *** : Duplicated function
- Remove
alonet.common.weights.vb_fodler
- add
create_if_not_found
option toalonet.common.pl_helpers.vb_folder
: if.aloception
does not exist inhome
, mkdir is called.
- Used the keyword arguments
**kwargs
to allow using differentpadding_mode
&fill
values - Updated the docstring
Closes #22
This PR improves the black square title displayed on views.
Issue: #12
- Add parameter to activate/deactivate title (default to True)
Test code (withadd_title=False
):
from aloscene import Frame
from alodataset import CocoBaseDataset
coco_dataset = CocoBaseDataset(sample=False, img_folder="test2017")
#checking if regular getitem works
stuff=coco_dataset.getitem(0)
stuff.get_view(add_title=False).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()
if f > 1:
break
- Improve title rendering: Use existing
put_adapative_cv2_text()
to add title in Renderer class. Improve the function to adapt text size to frame size. Decrease text size if text is too long.
Test code:
from aloscene import Frame
from alodataset import CocoBaseDataset
coco_dataset = CocoBaseDataset(sample=False, img_folder="test2017")
#checking if regular getitem works
stuff=coco_dataset.getitem(0)
stuff.get_view(add_title=True).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()
if f > 1:
break
General description of your pull request with the list of new features and/or bugs.
- New feature 1 : Support for pytorch 1.13
__torch_function__
was about to not be supported anymore. Switching to classmethod
was required. The current implementation seem to still be compatible with pytorch 1.10. Note that this change is touching to the most important/breakable part of the aug tensor pipeline.
Open discussion: Should be update the doc to make pytorch 1.13 the default ? I think not before to check for pytorch lightning support.
By the way: c8ed7f6b1cdfeeec369447517af7321349df1e25
All the named labels are displayed next to BoundingBoxes2D
- Labels BoundingBoxes2D : Render Labels next to BoundingBoxes2D FIX #221
import numpy as np
from aloscene import Frame, BoundingBoxes2D, Labels
frame = Frame(np.zeros((3, 100, 500)), normalization="01")
label = Labels([0, 1, 0])
label2 = Labels([0, 0, 1], labels_names=["red", "green"])
box = BoundingBoxes2D([[100, 20, 400, 80], [200, 40, 400, 80], [100, 40, 300, 80]], boxes_format="xyxy", absolute=True, frame_size=frame.HW)
box.append_labels(label, name="label")
box.append_labels(label2, name="label2")
frame.append_boxes2d(box)
print(box)
frame.get_view().render()
- First addition of issue #23 : being able to pad the tensor to the next multiple of
multiple
- unittest
Minimal example
>>> x = aloscene.Frame(torch.rand(1, 10, 10), names=('C', 'H', 'W'))
>>> x.pad(multiple=8).shape
torch.Size([1, 16, 16])
>>> x.pad(multiple=10).shape
torch.Size([1, 10, 10])
>>> x.pad(multiple=32).shape
torch.Size([1, 32, 32])
Fix the merging of tensor to allow torch.cat
to accept a tuple
of AugmentedTensor
.
- New feature : #260
# While overriding the exporter class
def __init__(dynamic: bool = False, **kwargs):
if dynamic:
# Keys are inputs names. Lists are indexes of axes that we want to set as dynamic.
self.dynamic_axes = {"input1": [1, 2, 3], "input2":[1, 2, 3]}
#....
- New feature #269 : Flexible onnx version
General description of your pull request with the list of new features and/or bugs.
- ***New feature 1 #85 *** : Now we can load a model directly from
run_id
without passingload_training
and Lightning module. weights
has highest priority. ifweights is None
, load model fromrun_id
is used.- We can choose to load best checkpoint or last checkpoint.
from alonet.common.weights import load_weights
from alonet.detr import DetrR50
model = DetrR50(num_classes=91, weights="detr-r50")
# load from downloaded weight
load_weights(model, weights="detr-r50")
# load from .pth file
load_weights(model, weights="~/.aloception/weights/detr-r50/detr-r50.pth")
# load from run_id
load_weights(model, run_id="your_run_id_heer", project_run_id="your_project_run_id",)
- New feature 1 : Rotate frame around a custom center
Torchvision Rotate transform supports the possibility to pass a "center" argument to rotate around a given center (and not only around the image center). I added this functionality to our Rotate Alotransform
from alodataset.coco_base_dataset import CocoBaseDataset
from alodataset.transforms import Rotate
coco_dataset = CocoBaseDataset(sample=True)
x = coco_dataset[0]
angle = 15.0
x = Rotate(angle, center=[650, 0])(x)
x.get_view().render()
- fix getitem on augmentedTensor with augmented tensor as mask.
- reset name only if tensor aren't linearized (like in bbox unit test) else declass to classic tensor
- Fix bug 309 : Wrong display of 3d boxes on padded images
The error was in the camera_calib code where two variables were misplaced.
New feature 1 : Added wandb hyperparameters logging
Now the hyperparameters are logged by default in wandb. The config of the experiment can be viewed in wandb=>overwiev=>config (see image below)
- Mean_std_norm no more uses resnet normalization and can be used for custom normalization :
Before, mean_std_norm used _resnet_mean_std by default, therefore you could only use resnet normalization. Now you can use any custom normalization.
import torch
import aloscene
x=torch.rand(3,600,600)
x=aloscene.Frame(x,mean_std=((0.333,0.333,0.333),(0.333,0.333,0.333)))
print("normalization de x ",x.normalization)
print("Mean_std de x",x.mean_std)
x=x.mean_std_norm(mean=(0.440,0.220,0.880), std=(0.333,0.333,0.333), name="my_norm")
print("normalization de x ",x.normalization)
print("Mean_std de x",x.mean_std)
Output :
normalization de x 255
Mean_std de x ((0.333, 0.333, 0.333), (0.333, 0.333, 0.333))
normalization de x my_norm
Mean_std de x ((0.44, 0.22, 0.88), (0.333, 0.333, 0.333))
- Conversion from mean_std_norm to minmax_sym and from minmax_sym to mean_std_norm
Added this conversion which raised an Exception before
import torch
import aloscene
x=torch.rand(3,600,600)
x=aloscene.Frame(x,mean_std=((0.333,0.333,0.333),(0.333,0.333,0.333)))
x = x.norm_minmax_sym()
print("normalization de x ",x.normalization)
print("Mean_std de x",x.mean_std)
x = x.mean_std_norm(mean=(0.333,0.333,0.333), std=(0.333,0.333,0.333), name="custom") # Exception raised
print("normalization de x ",x.normalization)
print("Mean_std de x",x.mean_std)
Output :
normalization de x minmax_sym
Mean_std de x None
normalization de x custom
Mean_std de x ((0.333, 0.333, 0.333), (0.333, 0.333, 0.333))
General description of your pull request with the list of new features and/or bugs.
-
Docker : New docker image with pytorch 1.13 support & pytorch lightning 1.9
-
Changed back transfrom to p=1.0 : transformation used to be apply automaticly on all frames. Last month we introduced a new parameter to randomly apply the transformation. The parameter was set to p=0.5 which might affect all the training pipeline. As of now we come back to p=1.0 as a default value (transformartion is always apply)
- Fix bug 309 : Wrong display of 3d boxes on padded images
The error was in the camera_calib code where two variables were misplaced.
What's Changed
- Alobugsdays - remove userwarning by @Data-Iab in #246
- Alobugsdays - Append Labels on BoundingBoxes3D by @Ardorax in #250
- alobugdays : added usable test split to CocoBaseDataset by @Dee61298 in #247
- alobugdays/221: label name next to 2D bounding box by @eleonorefrcs in #254
- alobugdays- dataset from directory by @Data-Iab in #248
- Alobugsdays - Typo in BoundingBoxes2D by @Ardorax in #255
- Alobugdays - Trt warnings by @Data-Iab in #258
- alobugdays : Issue15 Autodetermine Temporal position when calling .temporal() by @ragier in #263
- Alobugdays issue107 by @jsalotti in #266
- alobugdays/67-resnet-mean-std-norm-at-instantiation by @tflahaul in #270
- Prevent None accumulation by @thibo73800 in #268
- change vb_fodler to vb_folder by @anhtu293 in #273
- alobugdays/22-kwargs-padding_mode-&-more by @tflahaul in #276
- Alobugdays - 12 black square title by @eleonorefrcs in #275
- Support pytorch1.13 by @thibo73800 in #264
- 221 named labels on boundingboxes2d dont render by @Ardorax in #282
- Kitti: Documentation by @Ardorax in #288
- alobugdays 252 crowdhuman by @Dee61298 in #285
- Alobugdays : Add method to convert frame to uint8 numpy array by @eleonorefrcs in #280
- Alobugdays : added warning message for deformable detr by @Dee61298 in #279
- Alobugsdays - Debug print by @Ardorax in #297
- alobugdays/23-pad-accepts-multiple-argument by @tflahaul in #292
- 17 Not integer crop within recursion by @ragier in #294
- alobugdays/fix-pad-kwargs by @tflahaul in #289
- Alobugdays : Fix index of element to get in tutorials by @eleonorefrcs in #305
- fix cat for tuple of augmented tensor by @jsalotti in #307
- Alobugdays - add dynamic axes onnx option by @Data-Iab in #287
- Alobugdays - Onnx version by @Data-Iab in #295
- load model from run_id by @anhtu293 in #281
- Alobugdays : added "training" or "testing" param by @Dee61298 in #265
- Detach tensors not used for backprop by @Aurelien-VB in #299
- Alobugdays : Renderer class by @eleonorefrcs in #298
- Alobugsdays - Aloception Logo by @Ardorax in #259
- alobugdays : added center to rotate by @Dee61298 in #293
- getitem with augmentedTensor by @ragier in #284
- alobugdays : added wandb hyperparams logging to pl helpers by @Dee61298 in #300
- Fix camera_calibe to solve boxes 3d wrong display by @FlorianCoissac in #309
- allow batch_list to batch tensors with different children by @jsalotti in #304
- fixed the mean_std_norm function by @Dee61298 in #317
- Alobugdays by @Data-Iab in #318
- Some features that I needed when working on deformableDETR by @Dee61298 in #320
- feat -detr exportation- include preprocessing by @Data-Iab in #319
- Docker torch1.13 PL 1.9 - Transform p=1.0 by @thibo73800 in #321
New Contributors
- @eleonorefrcs made their first contribution in #254
- @FlorianCoissac made their first contribution in #309
Full Changelog: v0.4.0...v0.5.0-beta