-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo.html
289 lines (277 loc) · 16.4 KB
/
video.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!--
// Licensed under the Apache License. See footer for details.
-->
<div flex class="video-container" ng-controller="VideoController as controller" layout="row" ng-cloak>
<div flex layout="column">
<div class="header border-box" layout="row" layout-align="center center">
<div class="breadcrumb">
<a ui-sref="home()">
<md-icon md-font-library="material-icons">arrow_back</md-icon>
All Uploads
</a>
</div>
<div flex class="video-title border-box">
{{controller.data.video.title}}
</div>
<div>
<md-menu ng-if="controller.isVideo()">
<md-button class="video-menu-button md-icon-button" ng-click="$mdMenu.open()">
<md-icon md-font-library="material-icons">more_vert</md-icon>
</md-button>
<md-menu-content>
<md-menu-item>
<md-button ng-click="controller.resetImages()">
Reset All Images
</md-button>
</md-menu-item>
<md-menu-item>
<md-button ng-click="controller.resetAudio()">
Reset Audio
</md-button>
</md-menu-item>
<md-menu-item>
<md-button ng-click="controller.reset()">
Relaunch Video Analysis
</md-button>
</md-menu-item>
</md-menu-content>
</md-menu>
<md-menu ng-if="!controller.isVideo()">
<md-button class="video-menu-button md-icon-button" ng-click="$mdMenu.open()">
<md-icon md-font-library="material-icons">more_vert</md-icon>
</md-button>
<md-menu-content>
<md-menu-item>
<md-button ng-click="controller.reset()">
Relaunch Image Analysis
</md-button>
</md-menu-item>
<md-menu-divider></md-menu-divider>
<md-menu-item>
<md-button ng-click="controller.delete()">
Delete Image
</md-button>
</md-menu-item>
</md-menu-content>
</md-menu>
</div>
</div>
<div ng-if="!controller.data.video" flex layout="row" layout-align="center center">
<md-progress-circular class="loading" md-diameter="100" md-mode="indeterminate"></md-progress-circular>
</div>
<div ng-if="controller.data.video" flex layout="row">
{{ filteredImages = (controller.data.images | filter:search); "" }}
<div class="video-navigator" layout="column">
<div class="video-frame-count">
Video Frames ({{filteredImages.length}})
</div>
<div ng-click="controller.selectVideo();" ng-class="{ 'selected-frame': controller.isVideo() }" class="video-overview-box border-box" layout="row" layout-align="center center">
<div class="video-overview-thumbnail image-cover" ng-style="{'background-image': 'url(/images/thumbnail/' + controller.data.videoId + '.jpg'}">
</div>
<div flex class="video-overview-title">
Video overview
</div>
<div ng-if="controller.isVideo()" class="selected-frame-indicator">
<md-icon md-font-library="material-icons">play_arrow</md-icon>
</div>
</div>
<div class="search border-box" layout="row" layout-align="center center">
<md-icon md-font-library="material-icons">search</md-icon>
<input flex id="search" ng-model="search" type="search" placeholder="Filter image frame">
</div>
<div flex class="video-frames">
<div ng-class="{ 'selected-frame': image===controller.data.selected }" class="video-frame" ng-repeat="image in filteredImages" layout="row" layout-align="center center">
<div ng-class="{first: $index===0, last: $index===filteredImages.length-1}" class="video-frame-timeline"></div>
<div ng-if="image===controller.data.selected" class="selected-frame-indicator">
<md-icon md-font-library="material-icons">play_arrow</md-icon>
</div>
<span class="timecode">{{image.frame_timecode | formatSeconds }}</span>
<div ng-click="controller.selectImage(image);" class="video-frame-thumbnail image-cover" style="background-image: url(/images/image/{{image._id}}.jpg);">
</div>
</div>
<div class="no-frames" ng-if="filteredImages.length===0">
No frame
</div>
</div>
</div>
<div flex layout="column">
<div class="overview border-box">
<div class="width-wrapper" layout="row" layout-align="center center">
<div class="entry-thumbnail-container">
<div ng-if="!controller.isVideo() && face.face_location.left>0" ng-repeat="face in controller.data.selectedSummary.face_detection" class="face-overlay-box" style="position: absolute;
top: {{controller.facePositionAsPercent(face.face_location, controller.data.selected).top}}%;
left: {{controller.facePositionAsPercent(face.face_location, controller.data.selected).left}}%;
width: {{controller.facePositionAsPercent(face.face_location, controller.data.selected).width}}%;
height: {{controller.facePositionAsPercent(face.face_location, controller.data.selected).height}}%;"><span class="face-overlay-text">{{$index+1}}</span></div>
<img ng-if="controller.isVideo()" class="video-thumbnail" ng-src="/images/thumbnail/{{controller.data.selected._id}}.jpg" />
<img ng-if="!controller.isVideo()" class="video-thumbnail" ng-src="/images/image/{{controller.data.selected._id}}.jpg" />
<div ng-if="controller.isVideo()"class="video-box-tags" ng-repeat="stream in controller.data.video.metadata.streams">
<div ng-if="stream.codec_type == 'video'" class="text-muted">
<span class="video-box-tag">{{stream.width}}x{{stream.height}}</span>
<span class="video-box-tag">{{stream.duration | formatSeconds }}</span>
</div>
</div>
<div ng-if="!controller.isVideo()"class="video-box-tags" ng-repeat="stream in controller.data.video.metadata.streams">
<div class="text-muted">
<span class="video-box-tag">{{controller.data.selected.frame_timecode | formatSeconds }}</span>
</div>
</div>
</div>
<div flex class="entry-overview">
<div class="entry-overview-title">
<span ng-if="controller.isVideo()">Video Overview</span>
<span ng-if="!controller.isVideo()">Frame {{controller.data.selected.frame_number}} Overview</span>
</div>
<div ng-if="controller.isVideo()">
<div layout="row">
<div layout="column">
<div class="entry-overview-counter">
<span class="entry-overview-counter-title">Frames: </span>
<span class="entry-overview-counter-value">{{controller.data.images.length}}</span>
</div>
<div class="entry-overview-counter">
<span class="entry-overview-counter-title">Keywords: </span>
<span class="entry-overview-counter-value">{{controller.data.selectedSummary.image_keywords.length + controller.data.summary.audio.analysis.nlu.keywords.length}}</span>
</div>
</div>
<div layout="column">
<div class="entry-overview-counter">
<span class="entry-overview-counter-title">Entities: </span>
<span class="entry-overview-counter-value">{{controller.data.summary.audio.analysis.nlu.entities.length}}</span>
</div>
<div class="entry-overview-counter">
<span class="entry-overview-counter-title">Concepts: </span>
<span class="entry-overview-counter-value">{{controller.data.summary.audio.analysis.nlu.concepts.length}}</span>
</div>
</div>
</div>
</div>
<div ng-if="!controller.isVideo()">
<div layout="row">
<div layout="column">
<div class="entry-overview-counter">
<span class="entry-overview-counter-title">Keywords: </span>
<span class="entry-overview-counter-value">{{controller.data.selectedSummary.image_keywords.length}}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="insights" flex>
<div class="width-wrapper">
<div>
<h4>Face Detection</h4>
<span ng-if="controller.data.selectedSummary.face_detection.length == 0">No known face detected</span>
<ul class="entry-taglist">
<li ng-repeat="face in controller.data.selectedSummary.face_detection" class="entry-tag">
<span class="tag tag-face">
<span class="face-overlay-text">{{$index+1}}</span>
<span ng-if="face.identity">{{face.identity.name}} {{face.identity.score | formatPercent}}%</span>
<span ng-if="face.identity"> </span>
<span>{{face.gender.gender}} {{face.age.min}}-{{face.age.max}} {{face.age.score | formatPercent}}%</span>
</span>
</li>
</ul>
</div>
<div>
<h4>Image Keywords</h4>
<ul class="entry-taglist">
<li ng-repeat="keyword in controller.data.selectedSummary.image_keywords" class="entry-tag">
<span ng-class="{ 'hidden-tag': $index > 15 && !controller.showMoreKeywords }" class="tag tag-keyword">{{keyword.class}} {{keyword.score | formatPercent}}%</span>
</li>
<li ng-if="controller.data.selectedSummary.image_keywords.length > 15" class="entry-tag more-tag-toggle" ng-click="controller.showMoreKeywords = !controller.showMoreKeywords">
<span ng-if="!controller.showMoreKeywords">and {{controller.data.selectedSummary.image_keywords.length - 15}} more...</span>
<span ng-if="controller.showMoreKeywords">show less</span>
</li>
</ul>
</div>
<div ng-if="controller.isVideo() && controller.data.summary.audio.analysis.nlu.keywords">
<h4>Audio Keywords</h4>
<ul class="entry-taglist">
<li ng-repeat="keyword in controller.data.summary.audio.analysis.nlu.keywords" class="entry-tag">
<span ng-class="{ 'hidden-tag': $index > 15 && !controller.showMoreAudio }" class="tag tag-keyword">{{keyword.text}} {{keyword.relevance | formatPercent}}%</span>
</li>
<li ng-if="controller.data.summary.audio.analysis.nlu.keywords.length > 15" class="entry-tag more-tag-toggle" ng-click="controller.showMoreAudio = !controller.showMoreAudio">
<span ng-if="!controller.showMoreAudio">and {{controller.data.summary.audio.analysis.nlu.keywords.length - 15}} more...</span>
<span ng-if="controller.showMoreAudio">show less</span>
</li>
</ul>
</div>
<div ng-if="controller.isVideo() && controller.data.summary.audio.analysis.nlu.entities">
<h4>Entities</h4>
<span ng-if="controller.data.summary.audio.analysis.nlu.entities.length === 0">
No entity found
</span>
<ul class="entry-taglist" ng-if="controller.data.summary.audio.analysis.nlu.entities.length > 0">
<li ng-repeat="entity in controller.data.summary.audio.analysis.nlu.entities" class="entry-tag">
<span ng-class="{ 'hidden-tag': $index > 15 && !controller.showMoreEntities }" ng-if="entity.disambiguation.dbpedia_resource" class="tag"><a href="{{entity.disambiguation.dbpedia_resource}}">{{entity.text}} ({{entity.type}}) {{entity.relevance | formatPercent}}% <md-icon md-font-library="material-icons">open_in_new</md-icon></a></span>
<span ng-class="{ 'hidden-tag': $index > 15 && !controller.showMoreEntities }" ng-if="!entity.disambiguation.dbpedia_resource" class="tag">{{entity.text}} ({{entity.type}}) {{entity.relevance | formatPercent}}%</span>
</li>
<li ng-if="controller.data.summary.audio.analysis.nlu.entities.length > 15" class="entry-tag more-tag-toggle" ng-click="controller.showMoreEntities = !controller.showMoreEntities">
<span ng-if="!controller.showMoreEntities">and {{controller.data.summary.audio.analysis.nlu.entities.length - 15}} more...</span>
<span ng-if="controller.showMoreEntities">show less</span>
</li>
</ul>
</div>
<div ng-if="controller.isVideo() && controller.data.summary.audio.analysis.nlu.concepts">
<h4>Concepts</h4>
<span ng-if="controller.data.summary.audio.analysis.nlu.concepts.length === 0">
No concept found
</span>
<ul class="entry-taglist" ng-if="controller.data.summary.audio.analysis.nlu.concepts.length > 0">
<li ng-repeat="concept in controller.data.summary.audio.analysis.nlu.concepts" class="entry-tag">
<span ng-class="{ 'hidden-tag': $index > 15 && !controller.showMoreConcepts }" class="tag"><a href="{{concept.dbpedia_resource}}">{{concept.text}} {{concept.relevance | formatPercent}}% <md-icon md-font-library="material-icons">open_in_new</md-icon></a></span>
</li>
<li ng-if="controller.data.summary.audio.analysis.nlu.concepts.length > 15" class="entry-tag more-tag-toggle" ng-click="controller.showMoreConcepts = !controller.showMoreConcepts">
<span ng-if="!controller.showMoreConcepts">and {{controller.data.summary.audio.analysis.nlu.concepts.length - 15}} more...</span>
<span ng-if="controller.showMoreConcepts">show less</span>
</li>
</ul>
</div>
<div ng-if="controller.isVideo() && controller.data.summary.audio.analysis.nlu.emotion">
<h4>Emotion Analysis</h4>
<ul class="entry-taglist">
<li ng-repeat="(key, value) in controller.data.summary.audio.analysis.nlu.emotion.document.emotion" class="entry-tag">
<span class="tag">{{key}} {{value | formatPercent}}%</span>
</li>
</ul>
</div>
<div ng-if="controller.isVideo() && controller.data.summary.audio.transcript">
<h4>
Video Transcript <span class="small text-muted">(15 minutes max)</span>
</h4>
<div class="transcript border-box">
<span ng-repeat="transcript in allTranscripts = controller.data.summary.audio.transcript.results">
<span class="transcript-timestamp md-caption">
{{transcript.alternatives[0].timestamps[0][1] | formatSeconds }}
</span>
<span class="transcript-sentence">
{{transcript.alternatives[0].transcript | formatSentence}}.
</span>
<span class="transcript-break" ng-if="allTranscripts[$index + 1].alternatives[0].timestamps[0][1] - transcript.alternatives[0].timestamps[transcript.alternatives[0].timestamps.length - 1][2] > 1" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
//------------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//------------------------------------------------------------------------------
-->