Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
skin_detector
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
人工智能
skin_detector
Commits
b7f64d42
Commit
b7f64d42
authored
Apr 05, 2015
by
WillBrennan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added display method to scripts.py
parent
eb2895dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
scripts.py
scripts.py
+13
-2
No files found.
scripts.py
View file @
b7f64d42
...
...
@@ -9,6 +9,8 @@ import sys
import
argparse
import
logging
# Standard Modules
import
cv2
import
numpy
# Custom Modules
...
...
@@ -87,4 +89,13 @@ def xfind_images(directory, recursive=False, ignore=True):
check_a
=
path_a
.
split
(
'.'
)[
-
1
]
in
ext
check_b
=
ignore
or
(
'-'
not
in
path_a
.
split
(
'/'
)[
-
1
])
if
check_a
and
check_b
:
yield
path_a
\ No newline at end of file
yield
path_a
def
display
(
title
,
img
,
max_size
=
200000
):
assert
isinstance
(
img
,
numpy
.
ndarray
),
'img must be a numpy array'
assert
isinstance
(
title
,
str
),
'title must be a string'
scale
=
numpy
.
sqrt
(
min
(
1.0
,
float
(
max_size
)
/
(
img
.
shape
[
0
]
*
img
.
shape
[
1
])))
shape
=
(
int
(
scale
*
img
.
shape
[
1
]),
int
(
scale
*
img
.
shape
[
0
]))
img
=
cv2
.
resize
(
img
,
shape
)
cv2
.
imshow
(
title
,
img
)
\ No newline at end of file
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