Skip to content

Commit 621ecbf

Browse files
committed
fix bug(cv::Mat pass error)
1 parent 56f953c commit 621ecbf

8 files changed

+7
-3
lines changed

Yolov3_SpringEdition_Test/YOLOv3SE.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,11 @@ class YOLOv3 {
259259
unsigned char *data = (unsigned char *)src->imageData;
260260
int step = src->widthStep;
261261
int i, j, k;
262+
int rgbgr[3] = { 2,1,0 };
262263
for (i = 0; i < out.h; ++i) {
263264
for (k = 0; k < out.c; ++k) {
264265
for (j = 0; j < out.w; ++j) {
265-
out.data[k*out.w*out.h + i*out.w + j] = data[i*step + j*out.c + k] / 255.F;
266+
out.data[k*out.w*out.h + i*out.w + j] = data[i*step + j*out.c + rgbgr[k]] / 255.F;
266267
}
267268
}
268269
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:aa787b4fdd9fdb226b3b864a0ec90b2fade5e7698e533ec7c68753469a20f3b4
3+
size 3584

Yolov3_SpringEdition_Test/Yolov3_SpringEdition_CSTest/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Whitespace-only changes.

Yolov3_SpringEdition_Test/Yolov3_SpringEdition_CSTest/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Whitespace-only changes.

Yolov3_SpringEdition_Test/Yolov3_SpringEdition_CSTest/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

Whitespace-only changes.

Yolov3_SpringEdition_Test/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ void ClassifyTest() {
5959
}
6060
int main() {
6161
///Test YOLOv3 based on darknet53
62-
Yolo3Test("yolov3_darknet53.weights","yolov3_darknet53_coco.cfg","coco.names");
62+
//Yolo3Test("yolov3_darknet53.weights","yolov3_darknet53_coco.cfg","coco.names");
6363

6464
///Test YOLOv3 based on darknet53 with SPP(spatial pyramid pooling)
65-
//Yolo3Test("yolov3_darknet53_spp.weights", "yolov3_darknet53_spp_coco.cfg", "coco.names");
65+
Yolo3Test("yolov3_darknet53_spp.weights", "yolov3_darknet53_spp_coco.cfg", "coco.names");
6666

6767
///Test Classifier
6868
//ClassifyTest();

0 commit comments

Comments
 (0)