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

Docstring Typos #97

Merged
merged 18 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
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
282 changes: 221 additions & 61 deletions README.md

Large diffs are not rendered by default.

557 changes: 366 additions & 191 deletions configs/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions configs/classification_heavy_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: 200
Expand Down
4 changes: 2 additions & 2 deletions configs/classification_light_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: 200
Expand Down
56 changes: 28 additions & 28 deletions configs/complex_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ model:
- RepPANNeck

losses:
name: EfficientKeypointBboxLoss
- name: EfficientKeypointBboxLoss

metrics:
- name: ObjectKeypointSimilarity
is_main_metric: true
- name: MeanAveragePrecisionKeypoints

visualizers:
name: MultiVisualizer
params:
visualizers:
- name: KeypointVisualizer
params:
nonvisible_color: blue
- name: BBoxVisualizer
params:
colors:
person: "#FF5055"
- name: MultiVisualizer
params:
visualizers:
- name: KeypointVisualizer
params:
nonvisible_color: blue
- name: BBoxVisualizer
params:
colors:
person: "#FF5055"

- name: SegmentationHead
inputs:
- RepPANNeck
losses:
name: BCEWithLogitsLoss
- name: BCEWithLogitsLoss
metrics:
- name: F1Score
params:
Expand All @@ -47,9 +47,9 @@ model:
params:
task: binary
visualizers:
name: SegmentationVisualizer
params:
colors: "#FF5055"
- name: SegmentationVisualizer
params:
colors: "#FF5055"

- name: EfficientBBoxHead
inputs:
Expand All @@ -58,18 +58,18 @@ model:
conf_thres: 0.75
iou_thres: 0.45
losses:
name: AdaptiveDetectionLoss
- name: AdaptiveDetectionLoss
metrics:
name: MeanAveragePrecision
- name: MeanAveragePrecision
visualizers:
name: BBoxVisualizer
- name: BBoxVisualizer

tracker:
project_name: coco_test
save_directory: output
is_tensorboard: True
is_wandb: False
is_mlflow: False
is_tensorboard: true
is_wandb: false
is_mlflow: false

loader:
train_view: train
Expand All @@ -86,23 +86,23 @@ trainer:

n_sanity_val_steps: 1
profiler: null
verbose: True
verbose: true
batch_size: 8
accumulate_grad_batches: 1
epochs: &epochs 200
n_workers: 8
validation_interval: 10
n_log_images: 8
skip_last_batch: True
log_sub_losses: True
skip_last_batch: true
log_sub_losses: true
save_top_k: 3

preprocessing:
train_image_size: [&height 384, &width 384]
keep_aspect_ratio: True
train_rgb: True
keep_aspect_ratio: true
train_rgb: true
normalize:
active: True
active: true
augmentations:
- name: Defocus
params:
Expand Down Expand Up @@ -138,7 +138,7 @@ trainer:
params:
lr: 0.02
momentum: 0.937
nesterov: True
nesterov: true
weight_decay: 0.0005

scheduler:
Expand Down
4 changes: 2 additions & 2 deletions configs/detection_heavy_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down
4 changes: 2 additions & 2 deletions configs/detection_light_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down
6 changes: 3 additions & 3 deletions configs/example_export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down Expand Up @@ -46,5 +46,5 @@ exporter:
onnx:
opset_version: 11
blobconverter:
active: True
active: true
shaves: 8
4 changes: 2 additions & 2 deletions configs/example_tuning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true
augmentations:
- name: Defocus
params:
Expand Down
4 changes: 2 additions & 2 deletions configs/keypoint_bbox_heavy_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down
4 changes: 2 additions & 2 deletions configs/keypoint_bbox_light_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down
4 changes: 2 additions & 2 deletions configs/segmentation_heavy_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down
4 changes: 2 additions & 2 deletions configs/segmentation_light_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ loader:
trainer:
preprocessing:
train_image_size: [384, 512]
keep_aspect_ratio: True
keep_aspect_ratio: true
normalize:
active: True
active: true

batch_size: 8
epochs: &epochs 200
Expand Down
2 changes: 1 addition & 1 deletion luxonis_train/assigners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .atts_assigner import ATSSAssigner
from .atss_assigner import ATSSAssigner
from .tal_assigner import TaskAlignedAssigner

__all__ = ["ATSSAssigner", "TaskAlignedAssigner"]
4 changes: 2 additions & 2 deletions luxonis_train/assigners/tal_assigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ def __init__(
"""Task Aligned Assigner.

Adapted from: U{TOOD: Task-aligned One-stage Object Detection<https://arxiv.org/pdf/2108.07755.pdf>}.
Cose is adapted from: U{https://github.com/Nioolek/PPYOLOE_pytorch/blob/master/ppyoloe/assigner/tal_assigner.py}.
Code is adapted from: U{https://github.com/Nioolek/PPYOLOE_pytorch/blob/master/ppyoloe/assigner/tal_assigner.py}.

@license: U{Apache License, Version 2.0<https://github.com/Nioolek/PPYOLOE_pytorch/
tree/master?tab=Apache-2.0-1-ov-file#readme>}

@type n_classes: int
@param n_classes: Number of classes in the dataset.
@type topk: int
@param topk: Number of anchors considere in selection. Defaults to 13.
@param topk: Number of anchors considered in selection. Defaults to 13.
@type alpha: float
@param alpha: Defaults to 1.0.
@type beta: float
Expand Down
4 changes: 2 additions & 2 deletions luxonis_train/assigners/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def fix_collisions(


def batch_iou(batch1: Tensor, batch2: Tensor) -> Tensor:
"""Calculates IoU for each pair of bboxes in the batch. Bboxes must
be in xyxy format.
"""Calculates IoU for each pair of bounding boxes in the batch.
Bounding boxes must be in the "xyxy" format.

@type batch1: Tensor
@param batch1: Tensor of shape C{[bs, N, 4]}
Expand Down
9 changes: 5 additions & 4 deletions luxonis_train/attached_modules/base_attached_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class BaseAttachedModule(

Attached modules include losses, metrics and visualizers.

This class contains a default implementation of `prepare` method, which
This class contains a default implementation of C{prepare} method, which
should be sufficient for most simple cases. More complex modules should
override the `prepare` method.
override the C{prepare} method.

When subclassing, the following methods can be overridden:
- L{prepare}: Prepares node outputs for the forward pass of the module.
Expand Down Expand Up @@ -163,7 +163,8 @@ def node_tasks(self) -> dict[TaskType, str]:
"""Getter for the tasks of the attached node.

@type: dict[TaskType, str]
@raises RuntimeError: If the node does not have the `tasks` attribute set.
@raises RuntimeError: If the node does not have the C{tasks}
attribute set.
"""
if self.node._tasks is None:
raise RuntimeError(
Expand Down Expand Up @@ -250,7 +251,7 @@ def get_input_tensors(
@raises IncompatibleException: If the task is not present in the inputs.

@raises ValueError: If the module requires multiple labels.
For such cases, the `prepare` method should be overridden.
For such cases, the C{prepare} method should be overridden.
"""
if task_type is not None:
if isinstance(task_type, TaskType):
Expand Down
Loading