Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mednet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
medai
software
mednet
Commits
684bd8ce
Commit
684bd8ce
authored
8 months ago
by
Daniel CARRON
Browse files
Options
Downloads
Patches
Plain Diff
[tbx11k] Add parameter to avoid returning bounding boxes
parent
0d2f0163
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!55
Fix montgomery-shenzhen-indian-tbx11k datamodule
Pipeline
#89098
failed
8 months ago
Stage: qa
Stage: doc
Stage: dist
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mednet/config/data/montgomery_shenzhen_indian_tbx11k/datamodule.py
+1
-1
1 addition, 1 deletion
...nfig/data/montgomery_shenzhen_indian_tbx11k/datamodule.py
src/mednet/config/data/tbx11k/datamodule.py
+19
-4
19 additions, 4 deletions
src/mednet/config/data/tbx11k/datamodule.py
with
20 additions
and
5 deletions
src/mednet/config/data/montgomery_shenzhen_indian_tbx11k/datamodule.py
+
1
−
1
View file @
684bd8ce
...
...
@@ -40,7 +40,7 @@ class DataModule(ConcatDataModule):
indian_loader
=
IndianLoader
(
INDIAN_KEY_DATADIR
)
indian_package
=
IndianDataModule
.
__module__
.
rsplit
(
"
.
"
,
1
)[
0
]
indian_split
=
make_split
(
indian_package
,
split_filename
)
tbx11k_loader
=
TBX11kLoader
()
tbx11k_loader
=
TBX11kLoader
(
ignore_bboxes
=
True
)
tbx11k_package
=
TBX11kLoader
.
__module__
.
rsplit
(
"
.
"
,
1
)[
0
]
tbx11k_split
=
make_split
(
tbx11k_package
,
tbx11k_split_filename
)
...
...
This diff is collapsed.
Click to expand it.
src/mednet/config/data/tbx11k/datamodule.py
+
19
−
4
View file @
684bd8ce
...
...
@@ -168,19 +168,26 @@ finding locations, as described above.
class
RawDataLoader
(
_BaseRawDataLoader
):
"""
A specialized raw-data-loader for the TBX11k dataset.
"""
"""
A specialized raw-data-loader for the TBX11k dataset.
Parameters
----------
ignore_bboxes
If True, sample() does not return bounding boxes.
"""
datadir
:
pathlib
.
Path
"""
This variable contains the base directory where the database raw data is
stored.
"""
def
__init__
(
self
):
def
__init__
(
self
,
ignore_bboxes
:
bool
=
False
):
self
.
datadir
=
pathlib
.
Path
(
load_rc
().
get
(
CONFIGURATION_KEY_DATADIR
,
os
.
path
.
realpath
(
os
.
curdir
),
),
)
self
.
ignore_bboxes
=
ignore_bboxes
def
sample
(
self
,
sample
:
DatabaseSample
)
->
Sample
:
"""
Load a single image sample from the disk.
...
...
@@ -206,6 +213,12 @@ class RawDataLoader(_BaseRawDataLoader):
# to_pil_image(tensor).show()
# __import__("pdb").set_trace()
if
self
.
ignore_bboxes
:
return
tensor
,
dict
(
label
=
sample
[
1
],
name
=
sample
[
0
],
)
return
tensor
,
dict
(
label
=
sample
[
1
],
name
=
sample
[
0
],
...
...
@@ -356,13 +369,15 @@ class DataModule(CachingDataModule):
----------
split_filename
Name of the .json file containing the split to load.
ignore_bboxes
If True, sample() does not return bounding boxes.
"""
def
__init__
(
self
,
split_filename
:
str
):
def
__init__
(
self
,
split_filename
:
str
,
ignore_bboxes
:
bool
=
False
):
assert
__package__
is
not
None
super
().
__init__
(
database_split
=
make_split
(
__package__
,
split_filename
),
raw_data_loader
=
RawDataLoader
(),
raw_data_loader
=
RawDataLoader
(
ignore_bboxes
=
ignore_bboxes
),
database_name
=
__package__
.
rsplit
(
"
.
"
,
1
)[
1
],
split_name
=
pathlib
.
Path
(
split_filename
).
stem
,
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment