-
Notifications
You must be signed in to change notification settings - Fork 4
/
VitrivrVrConfig.cs
247 lines (208 loc) · 6.78 KB
/
VitrivrVrConfig.cs
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
using System;
using System.Collections.Generic;
using UnityEngine;
using Vitrivr.UnityInterface.CineastApi.Model.Config;
namespace VitrivrVR.Config
{
[Serializable]
public class BooleanCategory
{
public string name, selectionType, table, column;
public string[] options;
}
[Serializable]
public class VitrivrVrConfig
{
[Serializable]
public class ConfigColor
{
public float r, g, b;
public ConfigColor(float r, float g, float b)
{
this.r = r;
this.g = g;
this.b = b;
}
public Color ToColor() => new(r, g, b);
}
[Serializable]
public class TextCategory
{
public string name, id;
public TextCategory(string name, string id)
{
this.name = name;
this.id = id;
}
}
[Serializable]
public enum SpeechToText
{
DeepSpeech,
Whisper
}
[Serializable]
public enum ScoreFusion
{
MeanFusion,
SimpleFusion
}
/// <summary>
/// List of paths relative to persistent path pointing to all enabled Cineast instances.
/// </summary>
public List<string> cineastConfigs;
/// <summary>
/// The maximum number of results to accept from a single query.
/// </summary>
public int maxResults;
/// <summary>
/// The maximum number of items to display at once.
/// </summary>
public int maxDisplay;
/// <summary>
/// The color to indicate the minimum score for returned results.
/// </summary>
public ConfigColor dissimilarityColor;
/// <summary>
/// The color to indicate the maximum score for returned results.
/// </summary>
public ConfigColor similarityColor;
/// <summary>
/// The default categories for image query-by-example.
/// </summary>
public List<string> defaultImageCategories;
/// <summary>
/// The text categories to provide for text query terms.
/// Leave empty to disable.
/// </summary>
public List<TextCategory> textCategories;
/// <summary>
/// The categories for Boolean terms.
/// Leave empty to disable.
/// </summary>
public List<BooleanCategory> booleanCategories;
public bool tagTerm;
public bool mapTerm;
public bool poseTerm;
/// <summary>
/// The default volume [0, 1] to use for audio and video.
/// </summary>
public float defaultMediaVolume;
/// <summary>
/// The default length in seconds to skip using the skip controls for audio and video.
/// </summary>
public float skipLength;
/// <summary>
/// The default enabled speech-to-text method.
/// Specify as 0 for DeepSpeech or 1 for Whisper.
/// </summary>
public SpeechToText defaultSpeechToText;
/// <summary>
/// The default setting of whether to create a point cloud display for a query result.
/// </summary>
public bool createPointCloud;
/// <summary>
/// The maximum number of points to display in the point cloud.
/// </summary>
public int pointCloudPointLimit;
/// <summary>
/// The feature (more specifically feature table name) to use for dimensionality reduction.
/// </summary>
public string pointCloudFeature;
// TODO: Include configuration of point cloud dimensionality reduction
/// <summary>
/// Enables or disables DRES submission system integration and all associated functionality.
/// </summary>
public bool dresEnabled;
/// <summary>
/// Enables or disables text submission window (only enables if DRES is enabled as well).
/// </summary>
public bool textSubmissionEnabled;
/// <summary>
/// Enables connecting to a DRES instance with an invalid SSL certificate.
/// WARNING: This bypasses certificate validation, use at your own risk!
/// </summary>
public bool allowInvalidCertificate;
/// <summary>
/// A regex matching any part of the media object ID to be removed before submission.
/// If e.g. internal IDs start with "v_" while competition IDs do not, this parameter may be set to "^v_" to remove
/// this for submission to the competition system only.
/// </summary>
public string submissionIdReplacementRegex;
/// <summary>
/// The time interval between sending interaction logs to DRES.
/// </summary>
public float interactionLogSubmissionInterval;
/// <summary>
/// Enables writing results and interaction logs to file.
/// </summary>
public bool writeLogsToFile;
/// <summary>
/// Path to location where log files are to be written.
/// </summary>
public string logFileLocation;
/// <summary>
/// Enables a fix for the Vive streaming bug by periodically disabling and re-enabling UI interactions when no
/// interactions are detected.
/// </summary>
public bool viveStreamingFixEnabled;
/// <summary>
/// Enables reduced motion mode where result displays can be rotated by several degrees in discreet steps.
/// </summary>
public bool reduceMotion;
/// <summary>
/// Angle (in degrees) by which rotating displays should rotate at once in reduced motion mode.
/// </summary>
public float reduceMotionAngle;
/// <summary>
/// Score fusion to use for combining scores from different query components.
/// Specify as 0 for mean fusion or 1 for simple fusion.
/// </summary>
public ScoreFusion scoreFusion;
private VitrivrVrConfig()
{
cineastConfigs = new List<string> { "cineastapi.json" };
maxResults = 10000;
maxDisplay = 100;
dissimilarityColor = new ConfigColor(1, 0, 0);
similarityColor = new ConfigColor(0, 1, 0);
defaultImageCategories = new List<string>
{
CategoryMappings.GlobalColorCategory,
CategoryMappings.EdgeCategory
};
textCategories = new List<TextCategory>
{
new("OCR", "ocr"),
new("ASR", "asr"),
new("Caption", "scenecaption"),
new("Co-Embed", "visualtextcoembedding")
};
booleanCategories = new List<BooleanCategory>();
tagTerm = false;
mapTerm = false;
poseTerm = false;
defaultMediaVolume = .5f;
skipLength = 2.5f;
defaultSpeechToText = SpeechToText.Whisper;
createPointCloud = false;
pointCloudPointLimit = 2000;
pointCloudFeature = "openclip";
dresEnabled = false;
textSubmissionEnabled = true;
allowInvalidCertificate = false;
submissionIdReplacementRegex = "";
interactionLogSubmissionInterval = 10f;
writeLogsToFile = false;
logFileLocation = "session_logs/";
viveStreamingFixEnabled = true;
reduceMotion = false;
reduceMotionAngle = 30;
scoreFusion = ScoreFusion.MeanFusion;
}
public static VitrivrVrConfig GetDefault()
{
return new VitrivrVrConfig();
}
}
}