MATLAB Answers

0

trainingData from objectDete​ctorTraini​ngData

Asked by Derrick Bennett on 22 Jul 2019
Latest activity Commented on by Derrick Bennett on 5 Aug 2019
I am running:
trainingData = objectDetectorTrainingData(gTruth)
My gTruth file is generated from video, via the Matlab Video Labeler APP. When I run this command, I get a trainingData table and it then writes images to file from the video for each frame. My question is, can you run this command to get the trainingData table without writing the images to file? My reasoning is that I recently found a bug in some code that generate label txt files from the trainingData table. I need to go back through and run my code on the trainingData tables again but to get the trainingData tables again, i need to run the objectDetectTrainingData command. My previous images are fine so i dont need to regenerate them. I just need the trainingData table. It wouldn't be that big of a deal but my gTruth files exports roughly 20,000 images. So not only does it take forever to run the command, it eats up space during the process. So, is there any way to get the trainingData table without generating the images? Thanks in advance!

  0 Comments

Sign in to comment.

1 Answer

Answer by Sai Bhargav Avula on 31 Jul 2019

In the objectDetectorTrainingData function, the WriteLocation argument is by default set to pwd and in the present release it cannot be disabled. Hence it always writes the images while creating the training data table.

  3 Comments

Thank you for responding. Is there a way to make a feature request to have the ability to not write the images. Another problem i've notice is if your gTruth has too much data it will cause MATLAB to error because the pwd has to many items and MATLAB will run out of memory. I have been using the 'Video Labeler" app in matlab and for longer videos I can have upward of 30,000+ images. MATLAB will crash before it finishes writing the images. Any advice on how to work around this would be greatly appreciated. Also, I realize I could sample the gTruth file at a lower frequency but that is not ideal for my situation, as the instances I have in the gTruth are quality and I dont want to lose them. Thanks!
As of now, current version doesn't have that feature and I have informed the same with the concerned team. Coming to the out of memory problem you can try to reduce the memory requirement of the code. You can try processing the images in batches than everything at once. One other option would be using the uint8 instead of double for your images.
You can also try allocating more java heap memory to MATLAB.
For this go to : Preferences (in the Matlab tab "Home") --> General --> Java Heap Memory
Hope this helps !
Thanks again for the reply. Allocating more heap memory mad a huge improbement. thank you very much.

Sign in to comment.