public void OnFullQueryResult(StringDoublePair entry, MediaSegmentDescriptor segmentDescriptor, MediaObjectDescriptor objectDescriptor, string objModel) { results.Add(new QueryResult { score = entry.Value.Value, segmentDescriptor = segmentDescriptor, objectDescriptor = objectDescriptor, objModel = objModel }); }
public void OnFullQueryResult(StringDoublePair entry, MediaSegmentDescriptor segmentDescriptor, MediaObjectDescriptor objectDescriptor, string objModel) { Console.WriteLine("Downloaded Object: "); var lines = objModel.Split('\n'); int maxLines = Math.Min(lines.Length, 8); for (int i = 0; i < maxLines; i++) { Console.WriteLine(lines[i]); } Console.WriteLine("..."); Console.WriteLine("---------------------------"); Console.WriteLine(); }
public void OnFullQueryResult(StringDoublePair entry, MediaSegmentDescriptor segmentDescriptor, MediaObjectDescriptor objectDescriptor, string objModel) { Debug.Log("Downloaded Object: "); var lines = objModel.Split('\n'); int maxLines = Mathf.Min(lines.Length, 8); for (int i = 0; i < maxLines; i++) { Debug.Log(lines[i]); } Debug.Log("..."); Debug.Log("---------------------------"); Debug.Log(""); if (callback != null) { callback.OnFullQueryResult(entry, segmentDescriptor, objectDescriptor, objModel); } }
private string CompletePath(string path, MediaObjectDescriptor objectDescriptor, MediaSegmentDescriptor segmentDescriptor) { string suffix = DefaultSuffix; if (objectDescriptor.Mediatype.HasValue) { if (!suffices.TryGetValue(objectDescriptor.Mediatype.Value, out suffix)) { suffix = DefaultSuffix; } } //Same as in vitrivr-ng: https://github.com/vitrivr/vitrivr-ng/blob/master/src/app/core/basics/resolver.service.ts path = path.Replace(":o", objectDescriptor.ObjectId); path = path.Replace(":n", objectDescriptor.Name); path = path.Replace(":p", objectDescriptor.Path); path = path.Replace(":t", Enum.GetName(typeof(MediaObjectDescriptor.MediatypeEnum), objectDescriptor.Mediatype).ToLower()); path = path.Replace(":T", Enum.GetName(typeof(MediaObjectDescriptor.MediatypeEnum), objectDescriptor.Mediatype).ToUpper()); path = path.Replace(":s", segmentDescriptor.SegmentId); path = path.Replace(":x", "." + suffix); return(path); }
public async Task <Stream> RequestContentAsync(Apiv1Api api, MediaObjectDescriptor objectDescriptor, MediaSegmentDescriptor segmentDescriptor) { if (UseCineastServer) { return(await api.ApiV1GetObjectsIdGetAsync(objectDescriptor.ObjectId)); } if (UseDescriptorContentPath) { return(await httpClient.GetStreamAsync(HostBaseUrl + objectDescriptor.ContentURL)); } if (HostBaseUrl == null) { throw new InvalidOperationException("HostBaseUrl is null"); } return(await httpClient.GetStreamAsync(HostBaseUrl + CompletePath(HostContentPath, objectDescriptor, segmentDescriptor))); }
public MediaObjectQueryResult OnFinishObjectByIdQuery(SimilarityQueryResult queryResult, StringDoublePair entry, MediaSegmentDescriptor descriptor, MediaObjectQueryResult result) { return(result); }
public void OnStartObjectByIdQuery(SimilarityQueryResult queryResult, StringDoublePair entry, MediaSegmentDescriptor descriptor) { Console.WriteLine("Object ID: " + descriptor.ObjectId); }
public MediaObjectQueryResult OnFinishObjectByIdQuery(SimilarityQueryResult queryResult, StringDoublePair entry, MediaSegmentDescriptor descriptor, MediaObjectQueryResult result) { return(handler != null?handler.OnFinishObjectByIdQuery(queryResult, entry, descriptor, result) : result); }
public void OnStartObjectByIdQuery(SimilarityQueryResult queryResult, StringDoublePair entry, MediaSegmentDescriptor descriptor) { Debug.Log("Object ID: " + descriptor.ObjectId); if (handler != null) { handler.OnStartObjectByIdQuery(queryResult, entry, descriptor); } }