public async Task <IEnumerable <PhotoDto> > GetPhotosByPredictionAsync(double[] prediction, int skip)
        {
            var nearestCluster = await _clusterService.GetNearestClusterAsync(prediction);

            var photos = await _photoRepository.GetPagedByCluster(nearestCluster, skip, _feedSize);

            var photosDto = Mapper.Map <IList <PhotoDto> >(photos);

            return(photosDto);
        }
Exemple #2
0
        public async Task <IPhoto> FindMostSimilarPhotoAsync(double[] prediction, IEnumerable <Cluster> clusters)
        {
            var cluster = await _clusterService.GetNearestClusterAsync(prediction, clusters);

            return(await FindMostSimilarPhotoInCluster(prediction, cluster));
        }