From 84d6533cb8112f23a34d3de76435a10f4620f4b8 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 23 Oct 2017 13:43:03 +0000
Subject: [PATCH] Fixed OpenCV usage in the yolo_console_dll.cpp
---
src/blas.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/blas.c b/src/blas.c
index c6d59ea..31bd86b 100644
--- a/src/blas.c
+++ b/src/blas.c
@@ -5,6 +5,28 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+void reorg_cpu(float *x, int w, int h, int c, int batch, int stride, int forward, float *out)
+{
+ int b,i,j,k;
+ int out_c = c/(stride*stride);
+
+ for(b = 0; b < batch; ++b){
+ for(k = 0; k < c; ++k){
+ for(j = 0; j < h; ++j){
+ for(i = 0; i < w; ++i){
+ int in_index = i + w*(j + h*(k + c*b));
+ int c2 = k % out_c;
+ int offset = k / out_c;
+ int w2 = i*stride + offset % stride;
+ int h2 = j*stride + offset / stride;
+ int out_index = w2 + w*stride*(h2 + h*stride*(c2 + out_c*b));
+ if(forward) out[out_index] = x[in_index];
+ else out[in_index] = x[out_index];
+ }
+ }
+ }
+ }
+}
void flatten(float *x, int size, int layers, int batch, int forward)
{
--
Gitblit v1.10.0