Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pseudo_image
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Léo Schneider
pseudo_image
Commits
80e17afa
Commit
80e17afa
authored
2 weeks ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
fix : no noise threshold on ref image
parent
830d353e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
image_ref/config.py
+2
-2
2 additions, 2 deletions
image_ref/config.py
image_ref/dataset_ref.py
+0
-2
0 additions, 2 deletions
image_ref/dataset_ref.py
image_ref/grad_cam.py
+3
-3
3 additions, 3 deletions
image_ref/grad_cam.py
with
5 additions
and
7 deletions
image_ref/config.py
+
2
−
2
View file @
80e17afa
...
...
@@ -4,13 +4,13 @@ import argparse
def
load_args_contrastive
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
--epoches
'
,
type
=
int
,
default
=
0
)
parser
.
add_argument
(
'
--epoches
'
,
type
=
int
,
default
=
10
0
)
parser
.
add_argument
(
'
--save_inter
'
,
type
=
int
,
default
=
50
)
parser
.
add_argument
(
'
--eval_inter
'
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
'
--noise_threshold
'
,
type
=
int
,
default
=
500
)
parser
.
add_argument
(
'
--lr
'
,
type
=
float
,
default
=
0.001
)
parser
.
add_argument
(
'
--batch_size
'
,
type
=
int
,
default
=
64
)
parser
.
add_argument
(
'
--positive_prop
'
,
type
=
int
,
default
=
None
)
parser
.
add_argument
(
'
--positive_prop
'
,
type
=
int
,
default
=
30
)
parser
.
add_argument
(
'
--model
'
,
type
=
str
,
default
=
'
ResNet18
'
)
parser
.
add_argument
(
'
--dataset_train_dir
'
,
type
=
str
,
default
=
'
data/processed_data/npy_image/data_training_contrastive
'
)
parser
.
add_argument
(
'
--dataset_val_dir
'
,
type
=
str
,
default
=
'
data/processed_data/npy_image/data_test_contrastive
'
)
...
...
This diff is collapsed.
Click to expand it.
image_ref/dataset_ref.py
+
0
−
2
View file @
80e17afa
...
...
@@ -170,8 +170,6 @@ def load_data_duo(base_dir_train, base_dir_test, batch_size, shuffle=True, noise
ref_transform
=
transforms
.
Compose
(
[
transforms
.
Resize
((
224
,
224
)),
Threshold_noise
(
noise_threshold
),
Log_normalisation
(),
transforms
.
Normalize
(
0.5
,
0.5
)])
print
(
'
Default val transform
'
)
...
...
This diff is collapsed.
Click to expand it.
image_ref/grad_cam.py
+
3
−
3
View file @
80e17afa
...
...
@@ -25,9 +25,9 @@ def compute_class_activation_map():
path_aer
=
'
../data/processed_data/npy_image/data_test_contrastive/Citrobacter freundii/CITFRE17_AER.npy
'
path_ana
=
'
../data/processed_data/npy_image/data_test_contrastive/Citrobacter freundii/CITFRE17_ANA.npy
'
#
path_ref ='../image_ref/img_ref/Citrobacter freundii.npy' #positive
path_ref
=
'
../image_ref/img_ref/Citrobacter freundii.npy
'
#positive
# path_ref = '../image_ref/img_ref/Enterobacter hormaechei.npy' #negative
path_ref
=
'
../image_ref/img_ref/Proteus mirabilis.npy
'
# negative
#
path_ref = '../image_ref/img_ref/Proteus mirabilis.npy' # negative
tensor_aer
=
npy_loader
(
path_aer
)
tensor_ana
=
npy_loader
(
path_ana
)
tensor_ref
=
npy_loader
(
path_ref
)
...
...
@@ -36,7 +36,7 @@ def compute_class_activation_map():
tensor_aer
=
transform
(
tensor_aer
)
tensor_ana
=
transform
(
tensor_ana
)
tensor_ref
=
transform
(
tensor_ref
)
tensor_ref
=
ref_
transform
(
tensor_ref
)
tensor_aer
=
torch
.
unsqueeze
(
tensor_aer
,
dim
=
0
)
tensor_ana
=
torch
.
unsqueeze
(
tensor_ana
,
dim
=
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