Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FCN-CD-PyTorch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
manli
FCN-CD-PyTorch
Commits
e80c87ff
Commit
e80c87ff
authored
4 years ago
by
Bobholamovic
Browse files
Options
Downloads
Patches
Plain Diff
Fix filename without suffix
parent
a4d70bc2
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Update content
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/data/_AirChange.py
+3
-0
3 additions, 0 deletions
src/data/_AirChange.py
src/data/__init__.py
+5
-2
5 additions, 2 deletions
src/data/__init__.py
with
8 additions
and
2 deletions
src/data/_AirChange.py
+
3
−
0
View file @
e80c87ff
...
...
@@ -59,6 +59,9 @@ class _AirChangeDataset(CDDataset):
label
=
(
label
/
255.0
).
astype
(
np
.
uint8
)
# To 0,1
return
label
if
self
.
phase
==
'
train
'
else
self
.
cropper
(
label
)
def
get_name
(
self
,
index
):
return
'
{loc}-{id}-cm.bmp
'
.
format
(
loc
=
self
.
LOCATION
,
id
=
index
)
@staticmethod
def
_bmp_loader
(
bmp_path_wo_ext
):
# Case insensitive .bmp loader
...
...
This diff is collapsed.
Click to expand it.
src/data/__init__.py
+
5
−
2
View file @
e80c87ff
from
os.path
import
join
,
expanduser
,
basename
,
exists
from
os.path
import
join
,
expanduser
,
basename
,
exists
,
splitext
import
torch
import
torch.utils.data
as
data
...
...
@@ -41,7 +41,7 @@ class CDDataset(data.Dataset):
if
self
.
phase
==
'
train
'
:
return
t1
,
t2
,
label
else
:
return
basename
(
self
.
label_list
[
index
]
),
t1
,
t2
,
label
return
self
.
get_name
(
index
),
t1
,
t2
,
label
def
_read_file_paths
(
self
):
raise
NotImplementedError
...
...
@@ -52,6 +52,9 @@ class CDDataset(data.Dataset):
def
fetch_image
(
self
,
image_path
):
return
default_loader
(
image_path
)
def
get_name
(
self
,
index
):
return
splitext
(
basename
(
self
.
label_list
[
index
]))[
0
]
+
'
.bmp
'
def
preprocess
(
self
,
t1
,
t2
,
label
):
if
self
.
transforms
[
0
]
is
not
None
:
# Applied on all
...
...
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