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
7d4a2993
Commit
7d4a2993
authored
Jan 21, 2017
by
WillBrennan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opencv in travis plus unit tests
parent
3f3df2d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
.travis.yml
.travis.yml
+6
-0
Makefile
Makefile
+1
-1
__init__.py
tests/__init__.py
+0
-7
__init__.py
tests/skin_detector/__init__.py
+0
-7
test_unit.py
tests/skin_detector/test_unit.py
+15
-7
No files found.
.travis.yml
View file @
7d4a2993
language
:
python
language
:
python
dist
:
trusty
sudo
:
required
before_script
:
before_script
:
-
export PATH=/usr/bin:$PATH
-
pip install -U pytest
-
pip install -U pytest
-
sudo apt-get update -qq
-
sudo apt-get update -qq
-
sudo apt-get install -yq python-dev python-numpy python-opencv
-
sudo apt-get install -yq python-dev python-numpy python-opencv
-
sudo ln /dev/null /dev/raw1394
-
python -c "import cv2; print cv2.__version__"
-
python -c "import cv2; print cv2.__version__"
matrix
:
matrix
:
include
:
include
:
-
python
:
"
2.6"
-
python
:
"
2.6"
-
python
:
"
2.7"
-
python
:
"
2.7"
-
python
:
"
3.2"
-
python
:
"
3.2"
...
...
Makefile
View file @
7d4a2993
...
@@ -2,7 +2,7 @@ install:
...
@@ -2,7 +2,7 @@ install:
pip
install
-r
requirements.txt
pip
install
-r
requirements.txt
test
:
test
:
pyt
est
pyt
hon
-m
pytest tests/
yapf
:
yapf
:
find
.
-type
f
-name
"*.py"
| xargs yapf
-i
find
.
-type
f
-name
"*.py"
| xargs yapf
-i
tests/__init__.py
deleted
100644 → 0
View file @
3f3df2d0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__
=
'willbrennan'
# Built-in modules
# Standard modules
# Custom modules
tests/skin_detector/__init__.py
deleted
100644 → 0
View file @
3f3df2d0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__
=
'willbrennan'
# Built-in modules
# Standard modules
# Custom modules
tests/skin_detector/test_unit.py
View file @
7d4a2993
import
cv2
import
cv2
import
os
import
numpy
import
numpy
import
skin_detector
import
skin_detector
def
test_get_hsv_mask
():
def
test_get_hsv_mask
():
img
=
cv2
.
imread
(
"../test_image.png"
)
img_path
=
"tests/test_image.png"
img
=
cv2
.
imread
(
img_path
)
mask
=
skin_detector
.
get_hsv_mask
(
img
)
mask
=
skin_detector
.
get_hsv_mask
(
img
)
assert
img
.
shape
[:
2
]
==
mask
.
shape
assert
img
.
shape
[:
2
]
==
mask
.
shape
def
test_get_rgb_mask
():
def
test_get_rgb_mask
():
img
=
cv2
.
imread
(
"../test_image.png"
)
img_path
=
"tests/test_image.png"
img
=
cv2
.
imread
(
img_path
)
mask
=
skin_detector
.
get_rgb_mask
(
img
)
mask
=
skin_detector
.
get_rgb_mask
(
img
)
assert
img
.
shape
[:
2
]
==
mask
.
shape
assert
img
.
shape
[:
2
]
==
mask
.
shape
def
test_get_ycrcb_mask
():
def
test_get_ycrcb_mask
():
img
=
cv2
.
imread
(
"../test_image.png"
)
img_path
=
"tests/test_image.png"
img
=
cv2
.
imread
(
img_path
)
mask
=
skin_detector
.
get_ycrcb_mask
(
img
)
mask
=
skin_detector
.
get_ycrcb_mask
(
img
)
assert
img
.
shape
[:
2
]
==
mask
.
shape
assert
img
.
shape
[:
2
]
==
mask
.
shape
def
test_grab_cut_mask
():
def
test_grab_cut_mask
():
img
=
cv2
.
imread
(
"../test_image.png"
)
img_path
=
"tests/test_image.png"
img
=
cv2
.
imread
(
img_path
)
assert
True
assert
True
def
test_closing
():
def
test_closing
():
img
=
cv2
.
imread
(
"../test_image.png"
)
img_path
=
"tests/test_image.png"
img
=
cv2
.
imread
(
img_path
)
assert
True
assert
True
def
test_process
():
def
test_process
():
img
=
cv2
.
imread
(
"../test_image.png"
)
img_path
=
"tests/test_image.png"
assert
True
img
=
cv2
.
imread
(
img_path
)
mask
=
skin_detector
.
process
(
img
)
assert
img
.
shape
[:
2
]
==
mask
.
shape
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