weiliu89 / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
4.77k stars 1.67k forks source link

Can I adjust quality & output time of output video? #486

Open mintlatte opened 7 years ago

mintlatte commented 7 years ago

First, I wonder why quality of output video is lower than input video. What kind of things influence quality? And Can I improve quality?

Second I experienced delay between input of webcam and output of ssd. Maybe 1~1.5sec? Is the reason of delay desktop performance? (I use gtx750ti / i5-6600)

Thank you.

weiliu89 commented 7 years ago

Check DetectionOutputLayer visualization part for your first question

JimKlingshirn commented 7 years ago

Caffe uses the opencv and ffmpeg libraries for video input and output.

http://stackoverflow.com/questions/25998799/specify-compression-quality-in-python-for-opencv-video-object

mintlatte commented 7 years ago

I will try that. Thank you so much!

pnambiar commented 7 years ago

Have you figured this out ?

mintlatte commented 7 years ago

No, I do yet... But I found that cv::Mat image (it was input of VisualizeBBox) was produced by TransformInv in data_trasnformer.cpp.

So I think it is maybe major thing that determine quality.

pnambiar commented 7 years ago

ok. I will look into that file. So it looks like a caffe issue. Please let me know know if you make any progress.

mintlatte commented 7 years ago

Have you ever run ssd_pascal_video by 07++12+COCO/SSD_512x512 model? I run that and I thought its quality of result was better than 300x300 model. But just what i thought, its output fps was too slow.

pnambiar commented 7 years ago

No not yet. I modified the script to run COCO/SSD_300X300 model. I will try with 07++12+COCO model.

thanks, -P

JimKlingshirn commented 7 years ago

A simple way to create high quality video with openCV is to write individual frames to disk using cv::imwrite, instead of using videoWriter. Save them as consecutively numbered frames in png format, and create the final video using an ffmpeg command shell. This gives you total control over the compression codec, and compression quality.

On Wed, Mar 15, 2017 at 12:27 PM, pnambiar notifications@github.com wrote:

No not yet. I modified the script to run COCO/SSD_300X300 model. I will try with 07++12+COCO model.

thanks, -P

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/weiliu89/caffe/issues/486#issuecomment-286852890, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEZviVH3o5gIzu99C4upEi1Iys0KKLEks5rmDutgaJpZM4MXufb .

pnambiar commented 7 years ago

@JimKlingshirn
The resolution is pretty bad for the real-time output as well (even when we are not writing to a video file). So I'm assuming the problem is not with the VideoWriter

weiliu89 commented 7 years ago

The reason is because it resizes the input image to 300x300, which does not have high quality.