-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
932de71
commit b1646a3
Showing
8 changed files
with
69 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ | |
from .registries import * | ||
from .sa_med2d import * | ||
from .satin import * | ||
from .v3det import * | ||
from .zip import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
__all__ = [ | ||
'V3DetDataset', | ||
] | ||
|
||
import pathlib | ||
from typing import Literal | ||
|
||
from ..registries import DatasetRegistry | ||
from .access_layers.pil import PILAccessLayer | ||
from .coco import COCODataset | ||
|
||
Split = Literal['train', 'val'] | ||
Year = Literal[2023] | ||
Version = Literal['v1'] | ||
|
||
|
||
@DatasetRegistry.register_() | ||
class V3DetDataset(COCODataset): | ||
DATA_ROOT = pathlib.Path('data/v3det') | ||
ANNOTATIONS_ROOT = DATA_ROOT / 'annotations' | ||
|
||
def __init__( | ||
self, | ||
*args, | ||
split: Split, | ||
year: Year = 2023, | ||
version: Version = 'v1', | ||
access_layer: PILAccessLayer | None = None, | ||
annotations_file: pathlib.Path | str | None = None, | ||
**kwargs, | ||
) -> None: | ||
if access_layer is None: | ||
access_layer = PILAccessLayer( | ||
data_root=str(self.DATA_ROOT), | ||
suffix='jpg', | ||
) | ||
if annotations_file is None: | ||
annotations_file = ( | ||
self.ANNOTATIONS_ROOT / f'v3det_{year}_{version}_{split}.json' | ||
) | ||
|
||
super().__init__( | ||
*args, | ||
split=split, | ||
# year=..., # not used | ||
access_layer=access_layer, | ||
annotations_file=annotations_file, | ||
**kwargs, | ||
) |