예제 #1
0
 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();
            }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
 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);
 }
예제 #8
0
 public MediaObjectQueryResult OnFinishObjectByIdQuery(SimilarityQueryResult queryResult, StringDoublePair entry, MediaSegmentDescriptor descriptor, MediaObjectQueryResult result)
 {
     return(handler != null?handler.OnFinishObjectByIdQuery(queryResult, entry, descriptor, result) : result);
 }
예제 #9
0
 public void OnStartObjectByIdQuery(SimilarityQueryResult queryResult, StringDoublePair entry, MediaSegmentDescriptor descriptor)
 {
     Debug.Log("Object ID: " + descriptor.ObjectId);
     if (handler != null)
     {
         handler.OnStartObjectByIdQuery(queryResult, entry, descriptor);
     }
 }