BoxiHuang / EC500

EC500: Building Software
0 stars 0 forks source link

Google_Vision_API application on video #4

Open BoxiHuang opened 6 years ago

BoxiHuang commented 6 years ago

I am still wondering how to operate google vision api on video after successfully generate my output video. I am sort of confused how google vision API can implement on video and generate label descriptions as images are changing in my video.

BoxiHuang commented 6 years ago

I decide to generate my labels and superimpose those labels on the images and generate a video with the pictures that have descriptions. Within my second part of my code, I decide to create a counter called counter_two and rename all the pictures by order. In this way, i can use a for loop and loop through all the images to create image descriptions. After that, I superimpose those labels i generate from Google API and use PIL and its subfunction called ImageDraw, ImageFont. This step also require a second for loop to loop through each label within the labels list and superimpose. After saving all the new images after these steps, I save the new pictures and delete the old ones without the descriptions by using "newcommand = "rm " +name; os.system(newcommand)". So after this step, i can just use the ffmpeg code again to generate a video.

BoxiHuang commented 6 years ago

I am able to print out the labels from each pictures from the google api on the Common-line window.(Terminal) So this API allows us to have descriptive labels not only on the video, but also on the terminal.