Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
钟尚武
dlib
Commits
2369ae1e
Commit
2369ae1e
authored
Mar 02, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the python object detection tools process color images
in color instead of always converting to grayscale.
parent
849f3eb1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
train_object_detector.py
python_examples/train_object_detector.py
+1
-1
object_detection.cpp
tools/python/src/object_detection.cpp
+2
-1
simple_object_detector.h
tools/python/src/simple_object_detector.h
+2
-2
No files found.
python_examples/train_object_detector.py
View file @
2369ae1e
...
...
@@ -46,7 +46,7 @@ options.add_left_right_image_flips = True
# empirically by checking how well the trained detector works on a test set of
# images you haven't trained on. Don't just leave the value set at 1. Try a
# few different C values and see what works best for your data.
options
.
C
=
1
options
.
C
=
5
# Tell the code how many CPU cores your computer has for the fastest training.
options
.
num_threads
=
4
options
.
be_verbose
=
True
...
...
tools/python/src/object_detection.cpp
View file @
2369ae1e
...
...
@@ -68,10 +68,10 @@ std::vector<rectangle> run_detector (
)
{
pyramid_down
<
2
>
pyr
;
array2d
<
unsigned
char
>
temp
;
if
(
is_gray_python_image
(
img
))
{
array2d
<
unsigned
char
>
temp
;
if
(
upsampling_amount
==
0
)
{
return
detector
(
numpy_gray_image
(
img
));
...
...
@@ -94,6 +94,7 @@ std::vector<rectangle> run_detector (
}
else
if
(
is_rgb_python_image
(
img
))
{
array2d
<
rgb_pixel
>
temp
;
if
(
upsampling_amount
==
0
)
{
return
detector
(
numpy_rgb_image
(
img
));
...
...
tools/python/src/simple_object_detector.h
View file @
2369ae1e
...
...
@@ -127,7 +127,7 @@ namespace dlib
if
(
options
.
C
<=
0
)
throw
error
(
"Invalid C value given to train_simple_object_detector(), C must be > 0."
);
dlib
::
array
<
array2d
<
unsigned
char
>
>
images
;
dlib
::
array
<
array2d
<
rgb_pixel
>
>
images
;
std
::
vector
<
std
::
vector
<
rectangle
>
>
boxes
,
ignore
;
ignore
=
load_image_dataset
(
images
,
boxes
,
dataset_filename
);
...
...
@@ -225,7 +225,7 @@ namespace dlib
const
std
::
string
&
detector_filename
)
{
dlib
::
array
<
array2d
<
unsigned
char
>
>
images
;
dlib
::
array
<
array2d
<
rgb_pixel
>
>
images
;
std
::
vector
<
std
::
vector
<
rectangle
>
>
boxes
,
ignore
;
ignore
=
load_image_dataset
(
images
,
boxes
,
dataset_filename
);
...
...
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