Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
Painter_pytorch
Commits
a0e0b906
Commit
a0e0b906
authored
Jan 19, 2024
by
chenych
Browse files
update eval
parent
491d0cec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
eval/mmpose_custom/painter_inference_pose.py
eval/mmpose_custom/painter_inference_pose.py
+5
-5
eval/nyuv2_depth/eval.sh
eval/nyuv2_depth/eval.sh
+1
-1
eval/nyuv2_depth/eval_with_pngs.py
eval/nyuv2_depth/eval_with_pngs.py
+1
-1
No files found.
eval/mmpose_custom/painter_inference_pose.py
View file @
a0e0b906
...
@@ -44,7 +44,7 @@ def get_args_parser():
...
@@ -44,7 +44,7 @@ def get_args_parser():
default
=
'000000000165_box0'
)
default
=
'000000000165_box0'
)
parser
.
add_argument
(
'--input_size'
,
type
=
int
,
default
=
448
)
parser
.
add_argument
(
'--input_size'
,
type
=
int
,
default
=
448
)
parser
.
add_argument
(
'--flip_test'
,
action
=
'store_true'
,
help
=
'use offline bbox'
)
parser
.
add_argument
(
'--flip_test'
,
action
=
'store_true'
,
help
=
'use offline bbox'
)
parser
.
add_argument
(
'--data_dir'
,
type
=
str
,
default
=
'datasets'
)
# distributed training parameters
# distributed training parameters
parser
.
add_argument
(
'--world_size'
,
default
=
1
,
type
=
int
,
parser
.
add_argument
(
'--world_size'
,
default
=
1
,
type
=
int
,
help
=
'number of distributed processes'
)
help
=
'number of distributed processes'
)
...
@@ -93,7 +93,7 @@ def run_one_image(img, tgt, size, model, out_path, device):
...
@@ -93,7 +93,7 @@ def run_one_image(img, tgt, size, model, out_path, device):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
dataset_dir
=
"datasets/"
args
=
get_args_parser
()
args
=
get_args_parser
()
args
=
ddp_utils
.
init_distributed_mode
(
args
)
args
=
ddp_utils
.
init_distributed_mode
(
args
)
device
=
torch
.
device
(
"cuda"
)
device
=
torch
.
device
(
"cuda"
)
...
@@ -118,7 +118,7 @@ if __name__ == '__main__':
...
@@ -118,7 +118,7 @@ if __name__ == '__main__':
model_painter
=
prepare_model
(
ckpt_path
,
model
,
args
)
model_painter
=
prepare_model
(
ckpt_path
,
model
,
args
)
print
(
'Model loaded.'
)
print
(
'Model loaded.'
)
img_src_dir
=
dataset_dir
+
"
coco_pose/data_pair/test_256x192"
img_src_dir
=
"{}/
coco_pose/data_pair/test_256x192"
.
format
(
args
.
data_dir
)
if
args
.
flip_test
:
if
args
.
flip_test
:
img_src_dir
+=
"_flip"
img_src_dir
+=
"_flip"
...
@@ -128,8 +128,8 @@ if __name__ == '__main__':
...
@@ -128,8 +128,8 @@ if __name__ == '__main__':
data_loader_val
=
DataLoader
(
dataset_val
,
batch_size
=
1
,
sampler
=
sampler_val
,
data_loader_val
=
DataLoader
(
dataset_val
,
batch_size
=
1
,
sampler
=
sampler_val
,
drop_last
=
False
,
collate_fn
=
ddp_utils
.
collate_fn
,
num_workers
=
2
)
drop_last
=
False
,
collate_fn
=
ddp_utils
.
collate_fn
,
num_workers
=
2
)
img2_path
=
dataset_dir
+
"
coco_pose/data_pair/train_256x192_aug0/{}_image.png"
.
format
(
prompt
)
img2_path
=
"{}/
coco_pose/data_pair/train_256x192_aug0/{}_image.png"
.
format
(
args
.
data_dir
,
prompt
)
tgt2_path
=
dataset_dir
+
"
coco_pose/data_pair/train_256x192_aug0/{}_label.png"
.
format
(
prompt
)
tgt2_path
=
"{}/
coco_pose/data_pair/train_256x192_aug0/{}_label.png"
.
format
(
args
.
data_dir
,
prompt
)
# load the shared prompt image pair
# load the shared prompt image pair
img2
=
Image
.
open
(
img2_path
).
convert
(
"RGB"
)
img2
=
Image
.
open
(
img2_path
).
convert
(
"RGB"
)
...
...
eval/nyuv2_depth/eval.sh
View file @
a0e0b906
...
@@ -12,10 +12,10 @@ DST_DIR="models_inference/${JOB_NAME}/nyuv2_depth_inference_${CKPT_FILE}_${PROMP
...
@@ -12,10 +12,10 @@ DST_DIR="models_inference/${JOB_NAME}/nyuv2_depth_inference_${CKPT_FILE}_${PROMP
DATA_DIR
=
"datasets"
DATA_DIR
=
"datasets"
# inference
# inference
python
eval
/nyuv2_depth/painter_inference_depth.py
\
python
eval
/nyuv2_depth/painter_inference_depth.py
\
--data_dir
${
DATA_DIR
}
\
--ckpt_path
${
CKPT_PATH
}
--model
${
MODEL
}
--prompt
${
PROMPT
}
--ckpt_path
${
CKPT_PATH
}
--model
${
MODEL
}
--prompt
${
PROMPT
}
python
eval
/nyuv2_depth/eval_with_pngs.py
\
python
eval
/nyuv2_depth/eval_with_pngs.py
\
--pred_path
${
DST_DIR
}
\
--pred_path
${
DST_DIR
}
\
--gt_path
${
DATA_DIR
}
/nyu_depth_v2/official_splits/test/
\
--gt_path
${
DATA_DIR
}
/nyu_depth_v2/official_splits/test/
\
--data_dir
${
DATA_DIR
}
\
--dataset
nyu
--min_depth_eval
1e-3
--max_depth_eval
10
--eigen_crop
--dataset
nyu
--min_depth_eval
1e-3
--max_depth_eval
10
--eigen_crop
eval/nyuv2_depth/eval_with_pngs.py
View file @
a0e0b906
...
@@ -168,7 +168,7 @@ def eval(pred_depths):
...
@@ -168,7 +168,7 @@ def eval(pred_depths):
d1
=
np
.
zeros
(
num_samples
,
np
.
float32
)
d1
=
np
.
zeros
(
num_samples
,
np
.
float32
)
d2
=
np
.
zeros
(
num_samples
,
np
.
float32
)
d2
=
np
.
zeros
(
num_samples
,
np
.
float32
)
d3
=
np
.
zeros
(
num_samples
,
np
.
float32
)
d3
=
np
.
zeros
(
num_samples
,
np
.
float32
)
for
i
in
range
(
num_samples
):
for
i
in
range
(
num_samples
):
gt_depth
=
gt_depths
[
i
]
gt_depth
=
gt_depths
[
i
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment