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
8504a5f8
Commit
8504a5f8
authored
5 months ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[data.segment.shenzhen] Do not need to crop image to mask
parent
a604975e
No related branches found
No related tags found
1 merge request
!64
Add object detection
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mednet/data/segment/shenzhen.py
+2
-3
2 additions, 3 deletions
src/mednet/data/segment/shenzhen.py
with
2 additions
and
3 deletions
src/mednet/data/segment/shenzhen.py
+
2
−
3
View file @
8504a5f8
...
...
@@ -67,7 +67,6 @@ import torch
from
torchvision
import
tv_tensors
from
torchvision.transforms.v2.functional
import
to_dtype
,
to_image
from
...models.transforms
import
crop_image_to_mask
from
...utils.rc
import
load_rc
from
..datamodule
import
CachingDataModule
from
..split
import
JSONDatabaseSplit
...
...
@@ -116,8 +115,8 @@ class RawDataLoader(BaseDataLoader):
# use image as a base since target() can be overriden by child class
mask
=
torch
.
ones
((
1
,
image
.
shape
[
-
2
],
image
.
shape
[
-
1
]),
dtype
=
torch
.
float32
)
image
=
tv_tensors
.
Image
(
crop_image_to_mask
(
image
,
mask
)
)
target
=
tv_tensors
.
Mask
(
crop_image_to_mask
(
target
,
mask
)
)
image
=
tv_tensors
.
Image
(
image
)
target
=
tv_tensors
.
Mask
(
target
)
mask
=
tv_tensors
.
Mask
(
mask
)
return
dict
(
image
=
image
,
target
=
target
,
mask
=
mask
,
name
=
sample
[
0
])
...
...
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