π¨ [Add] Some TODO for improve the project
Browse files
yolo/model/yolo.py
CHANGED
@@ -79,6 +79,7 @@ class YOLO(nn.Module):
|
|
79 |
return output
|
80 |
|
81 |
def get_out_channels(self, layer_type: str, layer_args: dict, output_dim: list, source: Union[int, list]):
|
|
|
82 |
if any(module in layer_type for module in ["Conv", "ELAN", "ADown", "AConv"]):
|
83 |
return layer_args["out_channels"]
|
84 |
if layer_type == "CBFuse":
|
@@ -124,9 +125,9 @@ def create_model(model_cfg: ModelConfig, weight_path: Optional[str], class_num:
|
|
124 |
Returns:
|
125 |
YOLO: An instance of the model defined by the given configuration.
|
126 |
"""
|
|
|
127 |
OmegaConf.set_struct(model_cfg, False)
|
128 |
model = YOLO(model_cfg, class_num)
|
129 |
-
logger.info("β
Success load model")
|
130 |
if weight_path:
|
131 |
if not os.path.exists(weight_path):
|
132 |
logger.info(f"π Weight {weight_path} not found, try downloading")
|
|
|
79 |
return output
|
80 |
|
81 |
def get_out_channels(self, layer_type: str, layer_args: dict, output_dim: list, source: Union[int, list]):
|
82 |
+
# TODO refactor, check out_channels in layer_args, next check source is list, CBFuse|Concat
|
83 |
if any(module in layer_type for module in ["Conv", "ELAN", "ADown", "AConv"]):
|
84 |
return layer_args["out_channels"]
|
85 |
if layer_type == "CBFuse":
|
|
|
125 |
Returns:
|
126 |
YOLO: An instance of the model defined by the given configuration.
|
127 |
"""
|
128 |
+
# TODO: "weight_path -> weight = [True|None-False|Path]: True should be default of model name?"
|
129 |
OmegaConf.set_struct(model_cfg, False)
|
130 |
model = YOLO(model_cfg, class_num)
|
|
|
131 |
if weight_path:
|
132 |
if not os.path.exists(weight_path):
|
133 |
logger.info(f"π Weight {weight_path} not found, try downloading")
|
yolo/tools/data_augmentation.py
CHANGED
@@ -25,6 +25,9 @@ class AugmentationComposer:
|
|
25 |
return image, boxes
|
26 |
|
27 |
|
|
|
|
|
|
|
28 |
class PadAndResize:
|
29 |
def __init__(self, image_size):
|
30 |
"""Initialize the object with the target image size."""
|
|
|
25 |
return image, boxes
|
26 |
|
27 |
|
28 |
+
# TODO: RandomCrop, Resize, ... etc.
|
29 |
+
|
30 |
+
|
31 |
class PadAndResize:
|
32 |
def __init__(self, image_size):
|
33 |
"""Initialize the object with the target image size."""
|
yolo/tools/dataset_preparation.py
CHANGED
@@ -56,6 +56,7 @@ def prepare_dataset(dataset_cfg: DatasetConfig, task: str):
|
|
56 |
"""
|
57 |
Prepares dataset by downloading and unzipping if necessary.
|
58 |
"""
|
|
|
59 |
data_dir = dataset_cfg.path
|
60 |
for data_type, settings in dataset_cfg.auto_download.items():
|
61 |
base_url = settings["base_url"]
|
|
|
56 |
"""
|
57 |
Prepares dataset by downloading and unzipping if necessary.
|
58 |
"""
|
59 |
+
# TODO: do EDA of dataset
|
60 |
data_dir = dataset_cfg.path
|
61 |
for data_type, settings in dataset_cfg.auto_download.items():
|
62 |
base_url = settings["base_url"]
|