Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
darknet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KWIVER
darknet
Commits
a79299d3
Commit
a79299d3
authored
9 years ago
by
Joseph Redmon
Browse files
Options
Downloads
Patches
Plain Diff
NIPS demo
parent
cbc9984a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+7
-3
7 additions, 3 deletions
Makefile
src/detection.c
+5
-4
5 additions, 4 deletions
src/detection.c
src/image.c
+0
-7
0 additions, 7 deletions
src/image.c
with
12 additions
and
14 deletions
Makefile
+
7
−
3
View file @
a79299d3
GPU
=
1
OPENCV
=
1
GPU
=
0
OPENCV
=
0
DEBUG
=
0
ARCH
=
-arch
=
sm_52
...
...
@@ -42,7 +42,7 @@ endif
OBJS
=
$(
addprefix
$(
OBJDIR
)
,
$(
OBJ
))
DEPS
=
$(
wildcard src/
*
.h
)
Makefile
all
:
$(EXEC)
all
:
obj
$(EXEC)
$(EXEC)
:
$(OBJS)
$(
CC
)
$(
COMMON
)
$(
CFLAGS
)
$(
LDFLAGS
)
$^
-o
$@
...
...
@@ -53,6 +53,10 @@ $(OBJDIR)%.o: %.c $(DEPS)
$(OBJDIR)%.o
:
%.cu $(DEPS)
$(
NVCC
)
$(
ARCH
)
$(
COMMON
)
--compiler-options
"
$(
CFLAGS
)
"
-c
$<
-o
$@
obj
:
mkdir
-p
obj
.PHONY
:
clean
clean
:
...
...
This diff is collapsed.
Click to expand it.
src/detection.c
+
5
−
4
View file @
a79299d3
...
...
@@ -7,16 +7,16 @@
char
*
class_names
[]
=
{
"aeroplane"
,
"bicycle"
,
"bird"
,
"boat"
,
"bottle"
,
"bus"
,
"car"
,
"cat"
,
"chair"
,
"cow"
,
"diningtable"
,
"dog"
,
"horse"
,
"motorbike"
,
"person"
,
"pottedplant"
,
"sheep"
,
"sofa"
,
"train"
,
"tvmonitor"
};
void
draw_detection
(
image
im
,
float
*
box
,
int
side
,
int
bg
,
char
*
label
)
void
draw_detection
(
image
im
,
float
*
box
,
int
side
,
char
*
label
)
{
int
classes
=
20
;
int
elems
=
4
+
classes
+
bg
;
int
elems
=
4
+
classes
;
int
j
;
int
r
,
c
;
for
(
r
=
0
;
r
<
side
;
++
r
){
for
(
c
=
0
;
c
<
side
;
++
c
){
j
=
(
r
*
side
+
c
)
*
elems
+
bg
;
j
=
(
r
*
side
+
c
)
*
elems
;
int
class
=
max_index
(
box
+
j
,
classes
);
if
(
box
[
j
+
class
]
>
.
2
){
printf
(
"%f %s
\n
"
,
box
[
j
+
class
],
class_names
[
class
]);
...
...
@@ -212,6 +212,7 @@ void test_detection(char *cfgfile, char *weightfile)
load_weights
(
&
net
,
weightfile
);
}
detection_layer
layer
=
get_network_detection_layer
(
net
);
if
(
!
layer
.
joint
)
fprintf
(
stderr
,
"Detection layer should use joint prediction to draw correctly.
\n
"
);
int
im_size
=
448
;
set_batch_network
(
&
net
,
1
);
srand
(
2222222
);
...
...
@@ -227,7 +228,7 @@ void test_detection(char *cfgfile, char *weightfile)
time
=
clock
();
float
*
predictions
=
network_predict
(
net
,
X
);
printf
(
"%s: Predicted in %f seconds.
\n
"
,
filename
,
sec
(
clock
()
-
time
));
draw_detection
(
im
,
predictions
,
7
,
layer
.
background
||
layer
.
objectness
,
"predictions"
);
draw_detection
(
im
,
predictions
,
7
,
"predictions"
);
free_image
(
im
);
free_image
(
sized
);
#ifdef OPENCV
...
...
This diff is collapsed.
Click to expand it.
src/image.c
+
0
−
7
View file @
a79299d3
...
...
@@ -577,13 +577,6 @@ image resize_image(image im, int w, int h)
void
test_resize
(
char
*
filename
)
{
image
im
=
load_image
(
filename
,
0
,
0
,
3
);
image
small
=
resize_image
(
im
,
65
,
63
);
image
big
=
resize_image
(
im
,
513
,
512
);
image
crop
=
crop_image
(
im
,
50
,
10
,
100
,
100
);
image
crop2
=
crop_image
(
im
,
-
30
,
-
50
,
291
,
400
);
image
rot
=
rotate_image
(
big
,
.
02
);
image
rot2
=
rotate_image
(
big
,
3
.
14159265
/
2
.);
image
test
=
rotate_image
(
im
,
.
6
);
image
gray
=
grayscale_image
(
im
);
image
sat2
=
copy_image
(
im
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment