Dear Sir,
I am using Jetson Inference (detectnet) for object detection by @dusty_nv sir
I want to detect only humans and also draw simple rectangular boxes (also control its color)
I am not getting the right code where I can change.
I am making AI based social distance compliance which detects humans and then calculates distance and accordingly makes the alert.
Please help.
Thank you
Hi,
You can check the source code here:
{
const Detection det = detections[j];
detections[j] = detections[j+1];
detections[j+1] = det;
}
}
}
// renumber the instance ID's
for( int i=0; i < numDetections; i++ )
detections[i].Instance = i;
}
// from detectNet.cu
cudaError_t cudaDetectionOverlay( void* input, void* output, uint32_t width, uint32_t height, imageFormat format, detectNet::Detection* detections, int numDetections, float4* colors );
// Overlay
bool detectNet::Overlay( void* input, void* output, uint32_t width, uint32_t height, imageFormat format, Detection* detections, uint32_t numDetections, uint32_t flags )
{
PROFILER_BEGIN(PROFILER_VISUALIZE);
You can filter the output by checking the desired class ID and assign the bounding box color here:
void detectNet::SetClassColor( uint32_t classIndex, float r, float g, float b, float a )
{
if( classIndex >= GetNumClasses() || !mClassColors[0] )
return;
const uint32_t i = classIndex * 4;
mClassColors[0][i+0] = r;
mClassColors[0][i+1] = g;
mClassColors[0][i+2] = b;
mClassColors[0][i+3] = a;
}
Thanks.
Thank you for your help.
But nothing concrete came out of it.
I am using pednet
I have to detect all pedestrians in a frame and then calculate distance between then (for covid social distancing)
The people who are not following the social distancing should enclosed in red bounding box.
I changed the following
mClassColors[0][0] = r;
mClassColors[0][0] = r;
mClassColors[0][0] = r;
mClassColors[0][0] = r;
But there was no change when I ran my python file.
Even after removing the entire script(detectnet.cpp), the python file worked perfectly (isn’t that amazing).
Please find python file below
Please help @dusty_nv
Hi,
Have you recompiled it after the change?
If not, would you mind to try it?
Thanks.
Dear AsstaLLL,
Is there a way to modify cudaDetectionOverlay to draw circles instead of rectangles ?
I found similar questions but no specific answer about this point.
Thanks
kayccc
July 16, 2020, 6:35am
8
Hi adrien.laveau,
Please open a new topic for your issue. Thanks