1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KdanCommon.GoogleCloud.Data.Vision
- {
- public partial class ImgesRequest
- {
- [JsonProperty("requests")]
- public ImageRequest[] Requests { get; set; }
- public ImgesRequest(List<string> inputContents, string[] languageHints = null)
- {
- Requests = new ImageRequest[inputContents.Count];
- for (int i = 0; i < inputContents.Count; i++)
- {
- Requests[i] = new ImageRequest()
- {
- Image = new Image()
- {
- Content = inputContents[i]
- },
- Features = new Feature[]
- {
- new Feature()
- {
- Type = "TEXT_DETECTION"
- }
- },
- ImageContext = new ImageContext()
- {
- LanguageHints = languageHints
- }
- };
- }
- }
- }
- public partial class ImageRequest
- {
- [JsonProperty("image")]
- public Image Image { get; set; }
- [JsonProperty("features")]
- public Feature[] Features { get; set; }
- [JsonProperty("imageContext")]
- public ImageContext ImageContext { get; set; }
- }
- public partial class Feature
- {
- [JsonProperty("type")]
- public string Type { get; set; }
- }
- public partial class Image
- {
- [JsonProperty("content")]
- public string Content { get; set; }
- }
- public partial class ImageContext
- {
- [JsonProperty("languageHints")]
- public string[] LanguageHints { get; set; }
- }
- }
|