Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
strategy_embedding
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
strategy_embedding
Commits
390e41e0
Commit
390e41e0
authored
Sep 11, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update request f
parent
b773aebf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
images.py
src/utils/images.py
+4
-1
No files found.
src/utils/images.py
View file @
390e41e0
...
...
@@ -10,6 +10,7 @@ from PIL import Image
def
url_to_ndarray
(
url
):
try
:
result
=
requests
.
get
(
url
,
timeout
=
30
)
if
result
.
ok
:
img
=
Image
.
open
(
io
.
BytesIO
(
result
.
content
))
...
...
@@ -19,7 +20,9 @@ def url_to_ndarray(url):
else
:
print
(
"http get: {}"
.
format
(
result
.
status_code
))
return
np
.
array
([])
except
Exception
as
e
:
print
(
e
)
return
np
.
array
([])
def
file_to_ndarray
(
path
):
result
=
cv2
.
imread
(
path
)
...
...
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