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
47528e37
Commit
47528e37
authored
9 years ago
by
Joseph Redmon
Browse files
Options
Downloads
Patches
Plain Diff
crop layer scaling and trans on cpu
parent
d97331b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
src/activations.h
+2
-1
2 additions, 1 deletion
src/activations.h
src/cost_layer.c
+10
-9
10 additions, 9 deletions
src/cost_layer.c
src/crop_layer.c
+3
-1
3 additions, 1 deletion
src/crop_layer.c
src/detection.c
+0
-2
0 additions, 2 deletions
src/detection.c
with
16 additions
and
14 deletions
Makefile
+
1
−
1
View file @
47528e37
GPU
=
1
GPU
=
0
DEBUG
=
0
ARCH
=
-arch
=
sm_52
...
...
This diff is collapsed.
Click to expand it.
src/activations.h
+
2
−
1
View file @
47528e37
#include
"cuda.h"
#ifndef ACTIVATIONS_H
#define ACTIVATIONS_H
#include
"cuda.h"
#include
"math.h"
typedef
enum
{
LOGISTIC
,
RELU
,
RELIE
,
LINEAR
,
RAMP
,
TANH
,
PLSE
...
...
This diff is collapsed.
Click to expand it.
src/cost_layer.c
+
10
−
9
View file @
47528e37
...
...
@@ -38,15 +38,6 @@ cost_layer *make_cost_layer(int batch, int inputs, COST_TYPE type)
return
layer
;
}
void
pull_cost_layer
(
cost_layer
layer
)
{
cuda_pull_array
(
layer
.
delta_gpu
,
layer
.
delta
,
layer
.
batch
*
layer
.
inputs
);
}
void
push_cost_layer
(
cost_layer
layer
)
{
cuda_push_array
(
layer
.
delta_gpu
,
layer
.
delta
,
layer
.
batch
*
layer
.
inputs
);
}
void
forward_cost_layer
(
cost_layer
layer
,
network_state
state
)
{
if
(
!
state
.
truth
)
return
;
...
...
@@ -63,6 +54,16 @@ void backward_cost_layer(const cost_layer layer, network_state state)
#ifdef GPU
void
pull_cost_layer
(
cost_layer
layer
)
{
cuda_pull_array
(
layer
.
delta_gpu
,
layer
.
delta
,
layer
.
batch
*
layer
.
inputs
);
}
void
push_cost_layer
(
cost_layer
layer
)
{
cuda_push_array
(
layer
.
delta_gpu
,
layer
.
delta
,
layer
.
batch
*
layer
.
inputs
);
}
void
forward_cost_layer_gpu
(
cost_layer
layer
,
network_state
state
)
{
if
(
!
state
.
truth
)
return
;
...
...
This diff is collapsed.
Click to expand it.
src/crop_layer.c
+
3
−
1
View file @
47528e37
...
...
@@ -37,6 +37,8 @@ void forward_crop_layer(const crop_layer layer, network_state state)
int
flip
=
(
layer
.
flip
&&
rand
()
%
2
);
int
dh
=
rand
()
%
(
layer
.
h
-
layer
.
crop_height
+
1
);
int
dw
=
rand
()
%
(
layer
.
w
-
layer
.
crop_width
+
1
);
float
scale
=
2
;
float
trans
=
-
1
;
if
(
!
state
.
train
){
flip
=
0
;
dh
=
(
layer
.
h
-
layer
.
crop_height
)
/
2
;
...
...
@@ -53,7 +55,7 @@ void forward_crop_layer(const crop_layer layer, network_state state)
}
row
=
i
+
dh
;
index
=
col
+
layer
.
w
*
(
row
+
layer
.
h
*
(
c
+
layer
.
c
*
b
));
layer
.
output
[
count
++
]
=
state
.
input
[
index
];
layer
.
output
[
count
++
]
=
state
.
input
[
index
]
*
scale
+
trans
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/detection.c
+
0
−
2
View file @
47528e37
...
...
@@ -203,8 +203,6 @@ void test_detection(char *cfgfile, char *weightfile)
fgets
(
filename
,
256
,
stdin
);
strtok
(
filename
,
"
\n
"
);
image
im
=
load_image_color
(
filename
,
im_size
,
im_size
);
translate_image
(
im
,
-
128
);
scale_image
(
im
,
1
/
128
.);
printf
(
"%d %d %d
\n
"
,
im
.
h
,
im
.
w
,
im
.
c
);
float
*
X
=
im
.
data
;
time
=
clock
();
...
...
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