iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 9
0
Google Developers Machine Learning

Overview of Machine Learning Products系列 第 9

[Day 9] Google Video Intelligence AI - 子系列最終章

這系列的最後,也是要來AutoML一下。AutoML Video Intelligence,簡單的理解它就是Video Intelligence AI的UI版本,可以在這邊啟用:Video Intelligence

這有Quick start,我們就照著它做看一次。

首先,我們先建立dataset。
https://ithelp.ithome.com.tw/upload/images/20190916/20103835KIYy3qf3LT.jpg

然後,我們觀察一下範例檔案gsutil -m cp gs://automl-video-demo-data/hmdb_split1.csv .
https://ithelp.ithome.com.tw/upload/images/20190916/20103835B8pmQo4XEZ.jpg

原來這裡面就只有兩行

TRAIN,gs://automl-video-demo-data/hmdb_split1_5classes_train_inf.csv
TEST,gs://automl-video-demo-data/hmdb_split1_5classes_test_inf.csv

那train data csv裡面呢?它其實每一列格式像下面這樣:

VIDEO_SOURCE,LABEL,START_TIEM,END_TIME
gs://automl-video-demo-data/hmdb51/metacafe_coolsoccer_kick_ball_f_cm_np1_ba_bad_7.avi,kick_ball,0.0,inf

END_TIME inf則代表到結尾。
詳細CSV的格式這邊有更詳細的說明: https://cloud.google.com/video-intelligence/automl/docs/prepare?_ga=2.134679217.-1764044900.1562297905

載下來看看 gsutil -m cp gs://automl-video-demo-data/hmdb51/Wayne_Rooney_At_Home_Funny_Must_See_kick_ball_f_cm_np1_le_bad_5.avi .

好,開始import!!
https://ithelp.ithome.com.tw/upload/images/20190916/20103835ld5NkKUmbS.jpg

大概跑了五六分鐘以後,會跑出影片跟其對應的label:
https://ithelp.ithome.com.tw/upload/images/20190916/20103835HkPMtqakMu.jpg

(還好跟QuickStart不一樣,不然連圖片都還真有點像複製貼上)

接下來進入Train:
https://ithelp.ithome.com.tw/upload/images/20190916/20103835ianvDtFo5A.jpg
https://ithelp.ithome.com.tw/upload/images/20190916/20103835ywLh9GbBkK.jpg
注意他給的建議是至少100部,並分成7:3的Train set vs Test set

這邊還有索費的情況要特別注意:https://cloud.google.com/video-intelligence/automl/pricing?_ga=2.201247470.-1764044900.1562297905
You pay only for the computer hours used; if training fails for any reason other than a user-initiated cancellation, you are not billed for the time. You will be charged for training time if you cancel the operation.

這又是一個要跑幾個小時的動作......九點出門倒垃圾,回來一直等到11點才跑完。
https://ithelp.ithome.com.tw/upload/images/20190916/20103835uH8RZ9cUBg.jpg

我們跑到Evaluate,可以拖拉Threshold去調整你的Model,好讓後面的Test & Use使用。
https://ithelp.ithome.com.tw/upload/images/20190916/20103835mtI0w8cYxP.jpg

最後最後,我們開始測試了,這邊有個地方讓我鬼打牆很久,它output bucket一定要選擇us-central-1 region,我圈起來的地方你會看到這個小秘密。
https://ithelp.ithome.com.tw/upload/images/20190916/20103835ayqLPfKKAE.jpg

跑出來以後點下面的 VIEW 就可以看到結果啦!然後還會吐出Restful API給你呼叫,讓你可以跟你的服務或產品串在一起。至於準不準,就見仁見智了,不準的話就在優化,準的話就進行部屬。

好囉!今天到此為止。又體會了一個新的AI服務,每次都可以激發出不同的想像‧


上一篇
[Day 8] Google Video Intelligence AI - 3
下一篇
[Day 10] Google Natural Language - 1
系列文
Overview of Machine Learning Products30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言