mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Compile fixes
This commit is contained in:
@ -288,8 +288,8 @@ target_link_libraries(darknet PRIVATE Threads::Threads)
|
||||
target_link_libraries(darklib PRIVATE Threads::Threads)
|
||||
|
||||
if(ENABLE_CUDA)
|
||||
target_link_libraries(darknet PRIVATE curand cublas)
|
||||
target_link_libraries(darklib PRIVATE curand cublas)
|
||||
target_link_libraries(darknet PRIVATE curand cublas cuda)
|
||||
target_link_libraries(darklib PRIVATE curand cublas cuda)
|
||||
set_target_properties(darklib PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
|
@ -8,13 +8,14 @@ int gpu_index = 0;
|
||||
|
||||
#ifdef GPU
|
||||
|
||||
#include "cuda.h"
|
||||
#include "dark_cuda.h"
|
||||
#include "utils.h"
|
||||
#include "blas.h"
|
||||
#include "assert.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <cuda.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#pragma comment(lib, "cuda.lib")
|
||||
|
||||
|
@ -393,7 +393,7 @@ LIB_API bool Detector::send_json_http(std::vector<bbox_t> cur_bbox_vec, std::vec
|
||||
|
||||
char *tmp_buf = (char *)calloc(1024, sizeof(char));
|
||||
if (!filename.empty()) {
|
||||
sprintf(tmp_buf, "{\n \"frame_id\":%d, \n \"filename\":\"%s\", \n \"objects\": [ \n", frame_id, filename);
|
||||
sprintf(tmp_buf, "{\n \"frame_id\":%d, \n \"filename\":\"%s\", \n \"objects\": [ \n", frame_id, filename.c_str());
|
||||
}
|
||||
else {
|
||||
sprintf(tmp_buf, "{\n \"frame_id\":%d, \n \"objects\": [ \n", frame_id);
|
||||
@ -405,7 +405,7 @@ LIB_API bool Detector::send_json_http(std::vector<bbox_t> cur_bbox_vec, std::vec
|
||||
char *buf = (char *)calloc(2048, sizeof(char));
|
||||
|
||||
sprintf(buf, " {\"class_id\":%d, \"name\":\"%s\", \"absolute_coordinates\":{\"center_x\":%d, \"center_y\":%d, \"width\":%d, \"height\":%d}, \"confidence\":%f",
|
||||
i.obj_id, obj_names[i.obj_id], i.x, i.y, i.w, i.h, i.prob);
|
||||
i.obj_id, obj_names[i.obj_id].c_str(), i.x, i.y, i.w, i.h, i.prob);
|
||||
|
||||
//sprintf(buf, " {\"class_id\":%d, \"name\":\"%s\", \"relative_coordinates\":{\"center_x\":%f, \"center_y\":%f, \"width\":%f, \"height\":%f}, \"confidence\":%f",
|
||||
// i.obj_id, obj_names[i.obj_id], i.x, i.y, i.w, i.h, i.prob);
|
||||
@ -414,7 +414,7 @@ LIB_API bool Detector::send_json_http(std::vector<bbox_t> cur_bbox_vec, std::vec
|
||||
|
||||
if (!std::isnan(i.z_3d)) {
|
||||
sprintf(buf, "\n , \"coordinates_in_meters\":{\"x_3d\":%.2f, \"y_3d\":%.2f, \"z_3d\":%.2f}",
|
||||
i.x_3d*100, i.y_3d, i.z_3d);
|
||||
i.x_3d, i.y_3d, i.z_3d);
|
||||
send_str += buf;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user