Exemplo n.º 1
0
 public void TestInitialize()
 {
     _storageService        = Substitute.For <IStorageService>();
     _cognitiveService      = Substitute.For <ICognitiveService>();
     _hangoutsChatConnector = Substitute.For <IHangoutsChatConnector>();
     _timesheetService      = new TimesheetService(_storageService, _cognitiveService, _hangoutsChatConnector);
 }
Exemplo n.º 2
0
        public static async Task Run([BlobTrigger("spitball-user/profile/{id}/{filename}.{extension}")] CloudBlockBlob myBlob,
                                     string id,
                                     [Inject] ICognitiveService cognitiveService,
                                     ILogger log)
        {
            await myBlob.FetchAttributesAsync();

            if (myBlob.Metadata.TryGetValue("face", out _))
            {
                return;
            }
            log.LogInformation($"Processing {id}");
            await using var sr = await myBlob.OpenReadAsync();

            var result = await cognitiveService.DetectCenterFaceAsync(sr);

            if (result is null)
            {
                return;
            }
            myBlob.Metadata["face"] = $"{result.Value.X},{result.Value.Y}";
            await myBlob.SetMetadataAsync();

            log.LogInformation($"Finish Processing {id}");
        }
Exemplo n.º 3
0
 public void TestInitialize()
 {
     _cognitiveService = Substitute.For <ICognitiveService>();
     _asyncResponder   = Substitute.For <IAsyncResponder>();
     _logger           = Substitute.For <ILogger <HangoutsChatService> >();
     _service          = new HangoutsChatService(_cognitiveService, _asyncResponder, _logger);
 }
Exemplo n.º 4
0
 /// <summary>Initializes a new instance of the <see cref="HangoutsChatService"/> class.</summary>
 public HangoutsChatService(
     ICognitiveService cognitiveService,
     IAsyncResponder responder,
     ILogger <HangoutsChatService> logger)
 {
     _cognitiveService = cognitiveService;
     _responder        = responder;
     _logger           = logger;
 }
Exemplo n.º 5
0
 /// <summary>Initializes a new instance of the <see cref="TimesheetService"/> class.</summary>
 public TimesheetService(
     IStorageService storageService,
     ICognitiveService cognitiveService,
     IHangoutsChatConnector hangoutsChatConnector)
 {
     _storageService        = storageService;
     _cognitiveService      = cognitiveService;
     _hangoutsChatConnector = hangoutsChatConnector;
 }
 public ImagesController(ICognitiveService cognitiveService,
                         IStorageService storageService, IMapper mapper,
                         IImageRecognitionRepository imageRecognitionRepository,
                         ILoggerService loggerService) : base(mapper, loggerService)
 {
     _cognitiveService           = cognitiveService;
     _storageService             = storageService;
     _imageRecognitionRepository = imageRecognitionRepository;
 }
Exemplo n.º 7
0
 public AppController(IAktuelPageService aktuelPageService,
                      IAktuelService aktuelService,
                      ICompanyService companyService,
                      IQueueService queueService,
                      ICrawlerService crawlerService,
                      IUploadService uploadService,
                      ICognitiveService cognitiveService)
 {
     this.aktuelPageService = aktuelPageService;
     this.aktuelService     = aktuelService;
     this.companyService    = companyService;
     this.queueService      = queueService;
     this.crawlerService    = crawlerService;
     this.uploadService     = uploadService;
     this.cognitiveService  = cognitiveService;
 }
Exemplo n.º 8
0
 public TextController(ICognitiveService cognitiveService)
 {
     _cognitiveService = cognitiveService;
 }
Exemplo n.º 9
0
        public static async Task <ICognitiveService> SpeakAsync(this ICognitiveService service, Voice voice, string text)
        {
            await service.TextToSpeech(voice, text, TtsAudios.Wav.Riff16khz16bitMonoPcm).PlayWavAsync();

            return(service);
        }
Exemplo n.º 10
0
 public static Task <ICognitiveService> SpeakPolishAsync(this ICognitiveService service, string text) =>
 service.SpeakAsync(TtsVoices.Standard.pl_PL_PaulinaRUS, text);
Exemplo n.º 11
0
 public static Task <ICognitiveService> SpeakEnglishWomanAsync(this ICognitiveService service, string text) =>
 service.SpeakAsync(TtsVoices.Natural.en_US_JessaNeural, text);
 /// <summary>
 /// Initializes a new instance of the <see cref="DashboardFunction"/> class.
 /// </summary>
 /// <param name="schoolService">The schoolService<see cref="ISchoolService"/>.</param>
 /// <param name="studentService">The studentService<see cref="IStudentService"/>.</param>
 /// <param name="cognitiveService">The cognitiveService<see cref="ICognitiveService"/>.</param>
 public DashboardFunction(ISchoolService schoolService, IStudentService studentService, ICognitiveService cognitiveService)
 {
     _schoolService    = schoolService;
     _studentService   = studentService;
     _cognitiveService = cognitiveService;
 }
Exemplo n.º 13
0
 public MainViewModel(IMvxNavigationService navigationService, IMySeriesDataService dataService, IAudioRecorderService recorderService, ICognitiveService cognitiveService)
 {
     this.navigationService = navigationService;
     this.exploreViewModel  = new ExploreViewModel(navigationService, dataService);
     this.upcomingViewModel = new UpcomingViewModel(dataService);
     this.profileViewModel  = new ProfileViewModel(recorderService, cognitiveService);
 }
Exemplo n.º 14
0
 public AssetIngestionController(ICognitiveService cognitiveService)
 {
     _cognitiveService = cognitiveService;
 }
Exemplo n.º 15
0
 public HomeController(ICognitiveService cognitiveService) => _cognitiveService = cognitiveService;
Exemplo n.º 16
0
 public HomeController(IStorageService storageService, ICognitiveService cognitiveService)
 {
     _storageService   = storageService;
     _cognitiveService = cognitiveService;
 }
Exemplo n.º 17
0
 public PhotoController(ICognitiveService cognitiveService)
 {
     _cognitiveService = cognitiveService;
 }
Exemplo n.º 18
0
 /// <summary>Initializes a new instance of the <see cref="HangoutsChatService"/> class.</summary>
 public HangoutsChatService(ICognitiveService cognitiveService, IAsyncResponder responder)
 {
     _cognitiveService = cognitiveService;
     _responder        = responder;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CognitiveServiceFunction"/> class.
 /// </summary>
 /// <param name="cognitiveService">The cognitiveService<see cref="ICognitiveService"/>.</param>
 public CognitiveServiceFunction(ICognitiveService cognitiveService)
 {
     _cognitiveService = cognitiveService;
 }