Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
maskrcnn
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
人工智能
maskrcnn
Commits
5931f297
Commit
5931f297
authored
May 23, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix handle
parent
d1cb0ff2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
three_color.py
demo/three_color.py
+6
-5
No files found.
demo/three_color.py
View file @
5931f297
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import
argparse
import
argparse
import
cv2
import
cv2
import
urllib
import
numpy
as
np
from
maskrcnn_benchmark.config
import
cfg
from
maskrcnn_benchmark.config
import
cfg
from
demo.predictor
import
COCODemo
from
demo.predictor
import
COCODemo
...
@@ -69,11 +71,10 @@ def img_to_three_color_map(img):
...
@@ -69,11 +71,10 @@ def img_to_three_color_map(img):
def
handle_from_url
(
image_url
):
def
handle_from_url
(
image_url
):
""" 处理网路图片 """
""" 处理网路图片 """
cap
=
cv2
.
VideoCapture
(
image_url
)
resp
=
urllib
.
request
.
urlopen
(
image_url
)
if
(
cap
.
isOpened
()):
image
=
np
.
asarray
(
bytearray
(
resp
.
read
()),
dtype
=
"uint8"
)
ret
,
img
=
cap
.
read
()
image
=
cv2
.
imdecode
(
image
,
cv2
.
IMREAD_COLOR
)
return
img_to_three_color_map
(
img
)
return
img_to_three_color_map
(
image
)
return
None
def
handle_from_path
(
image_path
):
def
handle_from_path
(
image_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