🎨 [Add] type hint for converter, Anc2Box/Vec2Box
Browse files
yolo/utils/bounding_box_utils.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import math
|
2 |
-
from typing import Dict, List, Optional, Tuple
|
3 |
|
4 |
import torch
|
5 |
import torch.nn.functional as F
|
@@ -368,7 +368,7 @@ class Anc2Box:
|
|
368 |
return preds_cls, None, preds_box, preds_cnf.sigmoid()
|
369 |
|
370 |
|
371 |
-
def create_converter(model_version: str = "v9-c", *args, **kwargs):
|
372 |
if "v7" in model_version: # check model if v7
|
373 |
converter = Anc2Box(*args, **kwargs)
|
374 |
else:
|
|
|
1 |
import math
|
2 |
+
from typing import Dict, List, Optional, Tuple, Union
|
3 |
|
4 |
import torch
|
5 |
import torch.nn.functional as F
|
|
|
368 |
return preds_cls, None, preds_box, preds_cnf.sigmoid()
|
369 |
|
370 |
|
371 |
+
def create_converter(model_version: str = "v9-c", *args, **kwargs) -> Union[Anc2Box, Vec2Box]:
|
372 |
if "v7" in model_version: # check model if v7
|
373 |
converter = Anc2Box(*args, **kwargs)
|
374 |
else:
|