How to display a message if no object of interest in detected by yolov7? - computer-vision

I am working on a instance segmentation and object detection problem. The input is a cctv video and there are some time where there is nothing to detect. I would like a message "nothing of interest." to be displayed during this time. Should I code this in detect.py ? If so how and where ?
I am using Yolov7 with DeepSort for this application.
I am unsure as to which file to enter the code into. Would it be the detect.py or detection.py
I am using https://github.com/deshwalmahesh/yolov7-deepsort-tracking

Related

Qt debugging stops on deserialize

hi i'm working with dlib and I have this error about deserialize.
My exe file works fine, but it only stops when I try to debug it on my Qt creator.
It doesn't give me any error message, it just stops and does not works. I can't even press exit on my project, I can only make it stop by pressing 'stop debugging' button on Qt.
It does works when I run my exe file, so I have no idea what can be wrong. I tried to find out where the error occurs, and this is my code.
if (set)
{
//DNN for shape predictor
dlib::shape_predictor sp;
qDebug("on_pushButton_clicked"); // I get this
dlib::deserialize("shape_predictor_5_face_landmarks.dat") >> sp;
qDebug("destination"); // I don't get this message
//shape detector extracts face images from image
auto shape = sp(spimg, dets[0]);
dlib::matrix<dlib::rgb_pixel> face_chip;
dlib::extract_image_chip(spimg, dlib::get_face_chip_details(shape, 150, 0.25), face_chip);
//Add face to global variable
std_faces.push_back(std::move(face_chip));
//send signal to open the mainwindow
emit Photo::ClosedProperly();
keep_sending = true;
}
as I get the first qDebug message and it stops, so I suspect that in deserialize function my debugging stops for some reason. I'm keep searching about dlib and deserialize but I couldn't get satisfactory answer yet.. I'll keep looking on it, but I post this question that someone might experienced similar problem and has a clue to figure this out.
Thanks for reading this.
p.s. I think my debugging breakpoint doesn't work around that spot... this code is a part of on_pushButton_clicked() and it gives a qDebug message but breakpoint doesn't work. I'm not sure it's relative to the problem I have, but I add this information so it might help.

Qt program using Matlab dll, Initialized successfully in local disk, but failed in My U disk

I am writing a Qt program using matlab dll, the matlab function is very simple, However I encountered some exception caused by initializing problem. So I have changed my part of code as below.
void DicomViewer::on_pushButton_clicked()
{
if(libMyAddInitialize()){
mwArray dicomArray2=Mat2mwArray(dicomMat1);
//c_matlab(1,dicomArray2,Mat2mwArray(dicomMat1));
mwArry2Mat(dicomArray2).copyTo(dicomMat2);
dicomImgShow(TEMPDICOM2);
libMyAddTerminate();
}
}
This part of the code provides a button to change my cv::Mat data. I am using two functions Mat2mwArrayandmwArray2Mat to convert Mat between mwArray. Funciton dicomImgShow is to show the Mat to My program. That I think code is not the key problem.
My Key problem is The button function only work in my local disk (C:/ and D:/). I put it into my U disk and it failed. I also tried to run it in admin mode, but failed again. So I wonder what's wrong in my program.
Thanks for anyone who come to help .

QCamera::start gives mysterious "failed to start" log message

It's just plain luck my program is so simple, so I eventually found out what causes the mysterious log message. My program log looks like this:
Debugging starts
failed to start
Debugging has finished
Which happens after:
camera = new QCamera(QCameraInfo::defaultCamera());
// see http://omg-it.works/how-to-grab-video-frames-directly-from-qcamera/
camera->setViewfinder(frameGrabber = new CameraFrameGrabber());
camera->start();
The start() method causes this message in console. Now the meaning of the message is obvious, what it's not very helpful. What steps should I take to troubleshoot it?
Reasons for this might differ, but in my case it was simply because I provided invalid QCameraInfo. The culprit is that QCameraInfo::defaultCamera() might return invalid value if Qt fails to detect any cameras on your system, which unfortunately happens even if cameras are present.

Timed Indexed Color sets in CPN Tools that results in Unhandled Exception Error

I am using CPN Tools to model a distributed system. CPN Tools uses CPN ML an extension of SML. The project homepage is: cpntools.org
I started with a simple model and when I try to make a particular indexed color set timed, I get an "Internal error". There is another indexed colorset within my Petri-net model that is timed and works correctly. I am not sure how I can troubleshoot since I don't understand the error message. Could you help me interpret the error message or give me some hints on what I could be doing wrong?
The model is:
http://imgur.com/JUjPRHK
The declarations of the model are:
http://imgur.com/DvvpyvH
The error message is:
Internal error: Compile error when generating code. Caught error.../compiler/TopLevel/interact/evalloop.sml:296.17-296.20../compiler/TopLevel/interact/evalloop.sml:44.55../compiler/TopLevel/interact/evalloop.sml:66.19-66.27
structure CPN`TransitionID1413873858 = struct ... end (* see simulator debug info for full code *)
simglue.sml:884.12-884.43
"
Thank you~
I know this is an old question, but I run in the same problem and wasted too much time on this, so maybe it will help someone else in the future.
I didn't understand exactly the reason for this, but it seems the problem appears when you play with time values on an arch that ends to a transition (I was updating an integer value to the current time, using IntInf.toInt(time())). Now, if I move the code on the outgoing arch of that transition (that is: the one that ends in a place) there is no error.

Unable to find audio stream

I'm trying to adapt a code in order to add a sound capture feature (on a live stream), with the help of ffmpeg and directshow.
When i try to play with ffplay the AVIsynth file, everything works perfectly i've got the audio and video. But when i open this input file by code i only find the video stream.
The Avs file :
V = DirectShowSource("Decklink_HDMI.grf", fps=10, framecount=1000000000, seek=false, audio=false)
A = DirectShowSource("Decklink_Audio.grf", fps=1, framecount=1000000000, video=false)
AudioDub(V, A)
The opening code :
ffmpeg::AVInputFormat * ifmt;
ifmt = ffmpeg::av_find_input_format("avs");
// Open input file
if(ffmpeg::avformat_open_input(&pFormatCtx, filename.toStdString().c_str(), ifmt, NULL) != 0)
When i make a variable lookout on gdb just after the opening.
i'm looking at nb_streams in pFormatCtx->nb_streams and it's at 1
The only stream i can find in pFormatCtx->stream is a video one. And that's why i'm not able to capture the sound.
So i'm asking if i'm doing something wrong with my opening or if i miss something.
Ps : I know the code shown is short but the problem appears at this very step !
Thank you
Kurt
-- EDIT --
I've also noticed that when I dump the AVFormatContext the video stream got a 456x32 size.
And i can find this very same size of the window displayed when i try to launch a corrupted script with ffplay.
The original video format when i play the correct script with ffplay is of 1920x1080
I think my problem is maybe deeper than the simple fact of not being able to get the audio stream.
I'm trying to find out how to know the error message that is displayed on this 456x32 windows
-- EDIT2 --
I Find out what is written on this image and my problem is solved, badly placed avs script an old one was is place.
I'm ashamed.
My bad,
A badly placed avs file was my problem.
Anyway ffmpeg is a bit painful in his way of showing error, being forced to make a snapshot without any error msg or exception raised (or maybe did i failled).