mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Fix
This commit is contained in:
@ -148,7 +148,9 @@ void cudnn_convolutional_setup(layer *l, int cudnn_preference)
|
|||||||
cudnnDataType_t data_type = CUDNN_DATA_FLOAT;
|
cudnnDataType_t data_type = CUDNN_DATA_FLOAT;
|
||||||
#endif
|
#endif
|
||||||
// Tensor Core uses CUDNN_TENSOR_OP_MATH instead of CUDNN_DEFAULT_MATH
|
// Tensor Core uses CUDNN_TENSOR_OP_MATH instead of CUDNN_DEFAULT_MATH
|
||||||
|
#if(CUDNN_MAJOR >= 7)
|
||||||
cudnnSetConvolutionMathType(l->convDesc, CUDNN_TENSOR_OP_MATH);
|
cudnnSetConvolutionMathType(l->convDesc, CUDNN_TENSOR_OP_MATH);
|
||||||
|
#endif
|
||||||
|
|
||||||
// INT8_CONFIG, INT8_EXT_CONFIG, INT8x4_CONFIG and INT8x4_EXT_CONFIG are only supported
|
// INT8_CONFIG, INT8_EXT_CONFIG, INT8x4_CONFIG and INT8x4_EXT_CONFIG are only supported
|
||||||
// on architectures with DP4A support (compute capability 6.1 and later).
|
// on architectures with DP4A support (compute capability 6.1 and later).
|
||||||
|
@ -56,7 +56,7 @@ class MJPGWriter
|
|||||||
int timeout; // master sock timeout, shutdown after timeout millis.
|
int timeout; // master sock timeout, shutdown after timeout millis.
|
||||||
int quality; // jpeg compression [1..100]
|
int quality; // jpeg compression [1..100]
|
||||||
|
|
||||||
int _write(int sock, char *s, int len)
|
int _write(int sock, char const*const s, int len)
|
||||||
{
|
{
|
||||||
if (len < 1) { len = strlen(s); }
|
if (len < 1) { len = strlen(s); }
|
||||||
return ::send(sock, s, len, 0);
|
return ::send(sock, s, len, 0);
|
||||||
@ -128,7 +128,7 @@ public:
|
|||||||
params.push_back(IMWRITE_JPEG_QUALITY);
|
params.push_back(IMWRITE_JPEG_QUALITY);
|
||||||
params.push_back(quality);
|
params.push_back(quality);
|
||||||
cv::imencode(".jpg", frame, outbuf, params);
|
cv::imencode(".jpg", frame, outbuf, params);
|
||||||
unsigned int outlen = outbuf.size();
|
size_t outlen = outbuf.size();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
for (unsigned i = 0; i<rread.fd_count; i++)
|
for (unsigned i = 0; i<rread.fd_count; i++)
|
||||||
@ -169,7 +169,7 @@ public:
|
|||||||
else // existing client, just stream pix
|
else // existing client, just stream pix
|
||||||
{
|
{
|
||||||
char head[400];
|
char head[400];
|
||||||
sprintf(head, "--mjpegstream\r\nContent-Type: image/jpeg\r\nContent-Length: %lu\r\n\r\n", outlen);
|
sprintf(head, "--mjpegstream\r\nContent-Type: image/jpeg\r\nContent-Length: %zu\r\n\r\n", outlen);
|
||||||
_write(s, head, 0);
|
_write(s, head, 0);
|
||||||
int n = _write(s, (char*)(&outbuf[0]), outlen);
|
int n = _write(s, (char*)(&outbuf[0]), outlen);
|
||||||
//cerr << "known client " << s << " " << n << endl;
|
//cerr << "known client " << s << " " << n << endl;
|
||||||
|
@ -356,7 +356,7 @@ int resize_network(network *net, int w, int h)
|
|||||||
//fflush(stderr);
|
//fflush(stderr);
|
||||||
for (i = 0; i < net->n; ++i){
|
for (i = 0; i < net->n; ++i){
|
||||||
layer l = net->layers[i];
|
layer l = net->layers[i];
|
||||||
printf(" %d: layer = %d,", i, l.type);
|
//printf(" %d: layer = %d,", i, l.type);
|
||||||
if(l.type == CONVOLUTIONAL){
|
if(l.type == CONVOLUTIONAL){
|
||||||
resize_convolutional_layer(&l, w, h);
|
resize_convolutional_layer(&l, w, h);
|
||||||
}else if(l.type == CROP){
|
}else if(l.type == CROP){
|
||||||
|
Reference in New Issue
Block a user