Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210610347
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210610347
Commits
e6a5daab
Commit
e6a5daab
authored
3 years ago
by
hexiangdong2019
Browse files
Options
Downloads
Patches
Plain Diff
修改resize_long函数
parent
b0c78206
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+1
-2
1 addition, 2 deletions
main.py
with
1 addition
and
2 deletions
main.py
+
1
−
2
View file @
e6a5daab
...
...
@@ -42,6 +42,7 @@ def cal_hist(a, b, n):
return
np
.
bincount
(
n
*
a
[
k
].
astype
(
np
.
int32
)
+
b
[
k
],
minlength
=
n
**
2
).
reshape
(
n
,
n
)
def
resize_long
(
img
,
long_size
=
513
):
print
(
img
)
h
,
w
,
_
=
img
.
shape
if
h
>
w
:
new_h
=
long_size
...
...
@@ -117,10 +118,8 @@ def eval_batch(eval_net, img_lst, crop_size=513, flip=True):
def
eval_batch_scales
(
eval_net
,
img_lst
,
scales
,
base_crop_size
=
513
,
flip
=
True
):
print
(
scales
)
sizes_
=
[
int
((
base_crop_size
-
1
)
*
sc
)
+
1
for
sc
in
scales
]
probs_lst
=
eval_batch
(
eval_net
,
img_lst
,
crop_size
=
sizes_
[
0
],
flip
=
flip
)
print
(
sizes_
)
for
crop_size_
in
sizes_
[
1
:]:
probs_lst_tmp
=
eval_batch
(
eval_net
,
img_lst
,
crop_size
=
crop_size_
,
flip
=
flip
)
for
pl
,
_
in
enumerate
(
probs_lst
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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