-
Notifications
You must be signed in to change notification settings - Fork 6
/
ai-dam-config.xml
126 lines (117 loc) · 5.88 KB
/
ai-dam-config.xml
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
<?xml version="1.0"?>
<component name="org.nuxeo.ai.Pipeline.damConfig">
<require>org.nuxeo.runtime.stream.service</require>
<!-- IMAGES PIPELINE START -->
<!-- Listens for "pictureViewsGenerationDone" and sends "picture:views/3/content" to the "images" stream. -->
<extension point="pipes" target="org.nuxeo.ai.Pipeline">
<pipe id="pipe.dam.images" enabled="true" postCommit="true">
<supplier>
<event name="pictureViewsGenerationDone">
<filter class="org.nuxeo.ai.pipes.filters.NotSystemOrProxyFilter"/>
<filter class="org.nuxeo.ai.pipes.filters.NoVersionFilter"/>
<filter class="org.nuxeo.ai.pipes.filters.FacetFilter">
<option name="includedFacets">Picture</option>
</filter>
</event>
</supplier>
<consumer>
<stream name="ai/images"/>
</consumer>
<transformer class="org.nuxeo.ai.pipes.functions.PropertiesToStream">
<option name="blobProperties">picture:views/3/content</option>
<option name="blobPropertiesType">img</option>
</transformer>
</pipe>
</extension>
<!-- Read from the "images" stream, call aws.celebrityDetection and put the response in the
ai/images-enrichment-in stream -->
<extension target="org.nuxeo.runtime.stream.service" point="streamProcessor">
<streamProcessor name="celebrityProcessor" defaultConcurrency="2" defaultPartitions="4"
class="org.nuxeo.ai.enrichment.EnrichingStreamProcessor">
<option name="source">ai/images</option>
<option name="sink">ai/images-enrichment-in</option>
<option name="enrichmentProviderName">aws.celebrityDetection</option>
<option name="cache">true</option>
<policy name="default" maxRetries="1" delay="200ms" maxDelay="2s" continueOnFailure="true"/>
</streamProcessor>
</extension>
<!-- Read from the "ai/images-enrichment-in" stream, and raise an "imageMetadataCreated" event for each new enrichment entry. -->
<extension target="org.nuxeo.runtime.stream.service" point="streamProcessor">
<streamProcessor name="raiseEventProcessor" defaultConcurrency="2" defaultPartitions="4"
class="org.nuxeo.ai.functions.RaiseEnrichmentEvent">
<policy name="default" maxRetries="2" delay="200ms" maxDelay="2s" continueOnFailure="false"/>
<option name="source">ai/images-enrichment-in</option>
<option name="eventName">imageMetadataCreated</option>
</streamProcessor>
</extension>
<!-- A listener for the "imageMetadataCreated" event that just writes a log message. -->
<extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="event-handlers">
<handler chainId="metaListening">
<event>imageMetadataCreated</event>
</handler>
</extension>
<extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="chains">
<chain id="metaListening">
<operation id="Context.FetchDocument"/>
<operation id="Log">
<param type="string" name="level">warn</param>
<param type="string"
name="message">A new image event, you can use ctx.Event.context.getProperty("enrichmentMetadata")
</param>
<param type="string" name="category">org.nuxeo.ai.event</param>
</operation>
</chain>
</extension>
<!-- IMAGES PIPELINE END -->
<!-- VIDEO PIPELINE START -->
<!-- Listens for new "vid:storyboard" modifications for a path containing "movies"
and sends 4 of the video storyboard images to the "videos" stream. -->
<extension point="pipes" target="org.nuxeo.ai.Pipeline">
<pipe id="pipe.dam.video" enabled="true">
<supplier>
<event name="documentModified">
<filter class="org.nuxeo.ai.pipes.filters.NotSystemOrProxyFilter"/>
<filter class="org.nuxeo.ai.pipes.filters.NoVersionFilter"/>
<filter class="org.nuxeo.ai.pipes.filters.FacetFilter">
<option name="includedFacets">HasStoryboard</option>
</filter>
<filter class="org.nuxeo.ai.pipes.filters.DocumentPathFilter">
<option name="contains">movies</option>
</filter>
<filter class="org.nuxeo.ai.pipes.filters.DirtyPropertyFilter"/>
<option name="properties">vid:storyboard</option>
</event>
</supplier>
<consumer>
<stream name="video"/>
</consumer>
<transformer>
<option name="blobProperties">
vid:storyboard/1/content,vid:storyboard/2/content,vid:storyboard/3/content,vid:storyboard/4/content
</option>
<option name="blobPropertiesType">img,img,img,img</option>
</transformer>
</pipe>
</extension>
<!-- Read from the "video" stream, call aws.videoLabels and put the response in the
ai/video-enrichment-in stream -->
<extension target="org.nuxeo.runtime.stream.service" point="streamProcessor">
<streamProcessor name="labelsProcessor" defaultConcurrency="1" defaultPartitions="4"
class="org.nuxeo.ai.enrichment.EnrichingStreamProcessor">
<option name="source">ai/video</option>
<option name="sink">ai/video-enrichment-in</option>
<option name="enrichmentProviderName">aws.videoLabels</option>
<option name="cache">true</option>
<policy name="default" maxRetries="1" delay="200ms" maxDelay="2s" continueOnFailure="true"/>
</streamProcessor>
</extension>
<!-- Read from the "ai/video-enrichment-in" stream and create document tags for the enrichment labels -->
<extension target="org.nuxeo.runtime.stream.service" point="streamProcessor">
<streamProcessor name="tagsProcessor" defaultConcurrency="1" defaultPartitions="4"
class="org.nuxeo.ai.functions.StoreLabelsAsTags">
<policy name="default" maxRetries="2" delay="200ms" maxDelay="2s" continueOnFailure="false"/>
<option name="source">ai/video-enrichment-in</option>
</streamProcessor>
</extension>
<!-- VIDEO PIPELINE END -->
</component>