Skip to content

Commit

Permalink
Fix type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
gitttt-1234 committed Oct 3, 2024
1 parent ad8b4d7 commit c545857
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sleap_nn/data/get_data_chunks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Handles generating data chunks for training."""

from typing import Dict, Optional, Tuple, Union
from typing import Dict, Iterator, Optional, Tuple
from omegaconf import DictConfig
import numpy as np
import torch
Expand All @@ -18,7 +18,7 @@


def bottomup_data_chunks(
x: Tuple[Union[sio.LabeledFrame, int]],
x: Tuple[sio.LabeledFrame, int],
data_config: DictConfig,
max_instances: int,
user_instances_only: bool = True,
Expand Down Expand Up @@ -66,13 +66,13 @@ def bottomup_data_chunks(


def centered_instance_data_chunks(
x: Tuple[Union[sio.LabeledFrame, int]],
x: Tuple[sio.LabeledFrame, int],
data_config: DictConfig,
max_instances: int,
crop_size: Tuple[int],
anchor_ind: Optional[int],
user_instances_only: bool = True,
) -> Dict[str, torch.Tensor]:
) -> Iterator[Dict[str, torch.Tensor]]:
"""Generate dict from `sio.LabeledFrame`.
This function processes the input `sio.LabeledFrame`, applies data pre-processing
Expand Down Expand Up @@ -139,7 +139,7 @@ def centered_instance_data_chunks(


def centroid_data_chunks(
x: Tuple[Union[sio.LabeledFrame, int]],
x: Tuple[sio.LabeledFrame, int],
data_config: DictConfig,
max_instances: int,
anchor_ind: Optional[int],
Expand Down Expand Up @@ -196,7 +196,7 @@ def centroid_data_chunks(


def single_instance_data_chunks(
x: Tuple[Union[sio.LabeledFrame, int]],
x: Tuple[sio.LabeledFrame, int],
data_config: DictConfig,
user_instances_only: bool = True,
) -> Dict[str, torch.Tensor]:
Expand Down

0 comments on commit c545857

Please sign in to comment.