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
d795fdb9
Commit
d795fdb9
authored
May 24, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do test img
parent
152d2753
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
predictor.py
demo/predictor.py
+2
-2
work.py
demo/work.py
+12
-12
test.py
test.py
+4
-2
No files found.
demo/predictor.py
View file @
d795fdb9
...
@@ -308,12 +308,12 @@ class COCODemo(object):
...
@@ -308,12 +308,12 @@ class COCODemo(object):
a
,
b
,
c
=
img
.
shape
a
,
b
,
c
=
img
.
shape
for
x
in
range
(
a
):
for
x
in
range
(
a
):
for
y
in
range
(
b
):
for
y
in
range
(
b
):
if
img
[
x
,
y
]
.
tolist
()
<
[
5
,
5
,
5
]:
if
img
[
x
,
y
]
.
tolist
()
==
[
0
,
0
,
0
]:
break
break
img
[
x
,
y
]
=
[
0
,
0
,
0
]
img
[
x
,
y
]
=
[
0
,
0
,
0
]
for
y
in
range
(
b
-
1
,
0
,
-
1
):
for
y
in
range
(
b
-
1
,
0
,
-
1
):
if
img
[
x
,
y
]
.
tolist
()
<
[
5
,
5
,
5
]:
if
img
[
x
,
y
]
.
tolist
()
==
[
0
,
0
,
0
]:
break
break
img
[
x
,
y
]
=
[
0
,
0
,
0
]
img
[
x
,
y
]
=
[
0
,
0
,
0
]
...
...
demo/work.py
View file @
d795fdb9
...
@@ -19,18 +19,18 @@ def main():
...
@@ -19,18 +19,18 @@ def main():
path
=
'/data/images/dataset_0523/'
path
=
'/data/images/dataset_0523/'
rs
=
os
.
walk
(
path
)
rs
=
os
.
walk
(
path
)
for
a
,
b
,
files
in
rs
:
for
a
,
b
,
files
in
rs
:
print
(
a
)
if
b
==
[]:
for
file
in
files
[:
5000
]:
for
file
in
files
[:
5000
]:
dir
=
a
.
replace
(
'dataset_0523'
,
'dataset_0523_first'
)
dir
=
a
.
replace
(
'dataset_0523'
,
'dataset_0523_first'
)
fold
=
os
.
path
.
exists
(
dir
)
fold
=
os
.
path
.
exists
(
dir
)
if
not
fold
:
if
not
fold
:
os
.
mkdir
(
dir
)
os
.
mkdir
(
dir
)
source_path
=
a
+
file
source_path
=
a
+
file
target_path
=
dir
+
file
target_path
=
dir
+
file
print
(
source_path
)
print
(
source_path
)
print
(
target_path
)
print
(
target_path
)
#write_redis(source_path, target_path)
#write_redis(source_path, target_path)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
test.py
View file @
d795fdb9
...
@@ -7,13 +7,15 @@ def read_excel():
...
@@ -7,13 +7,15 @@ def read_excel():
data
=
xlrd
.
open_workbook
(
'20190522上衣测试.xlsx'
)
data
=
xlrd
.
open_workbook
(
'20190522上衣测试.xlsx'
)
table
=
data
.
sheets
()[
0
]
table
=
data
.
sheets
()[
0
]
nrows
=
table
.
nrows
nrows
=
table
.
nrows
for
i
in
range
(
nrows
):
for
i
in
range
(
1
,
nrows
+
1
):
url
=
table
.
row_values
(
i
)[
1
]
url
=
table
.
row_values
(
i
)[
1
]
tag
=
table
.
row_values
(
i
)[
2
]
path
=
url
.
split
(
'/'
)[
-
1
]
path
=
url
.
split
(
'/'
)[
-
1
]
path
=
path
.
split
(
'-'
)[
0
]
path
=
path
.
split
(
'-'
)[
0
]
path
=
tag
+
'_'
+
path
print
(
path
)
print
(
path
)
img
=
handle_from_url
(
url
)
img
=
handle_from_url
(
url
)
cv2
.
imwrite
(
'
/test
/'
+
path
,
img
)
cv2
.
imwrite
(
'
tem
/'
+
path
,
img
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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