public static async Task Main(string[] args) { var q2 = new ImageQuery("https://i.imgur.com/QtCausw.jpg"); var q = new ImageQuery(@"C:\Users\Deci\Pictures\fucking_epic.jpg"); var cfg = new SearchConfig() { Query = q, SearchEngines = SearchEngineOptions.All }; var cl = new SearchClient(cfg); var r = cl.RunSearchAsync(); await r; foreach (var result in cl.Results) { Console.WriteLine(result); } Console.WriteLine("--"); var i = new IqdbEngine(); var i2 = i.GetResultAsync(q2); var r2 = await i2; Console.WriteLine(r2); }
public async Task TestIqdb(string art) { var q = new ImageQuery(art); var i = new IqdbEngine(); var rt = i.GetResultAsync(q); var t = await rt; if (t.Status == ResultStatus.Unavailable) { Assert.Inconclusive(); } //t.Consolidate(); var a = t.IsNonPrimitive; var b = t.OtherResults.Any(r => { return(r.DetailScore >= 3 && r.Site != null); }); Assert.True(a || b); }
public static async Task Main(string[] args) { Console.OutputEncoding = Encoding.Unicode; var q = new ImageQuery(@"C:\Users\Deci\Pictures\fucking_epic.jpg"); var q2 = new ImageQuery("https://i.imgur.com/QtCausw.jpg"); var q3 = new ImageQuery(@"C:\Users\Deci\RiderProjects\SmartImage\SmartImage\Test4.png"); var cfg = new SearchConfig() { Query = q, SearchEngines = SearchEngineOptions.All }; var cl = new SearchClient(cfg); Console.WriteLine("Search 1"); var r = cl.RunSearchAsync(); await r; foreach (var result in cl.Results) { Console.WriteLine(result); } Console.WriteLine("--"); var i = new IqdbEngine(); var i2 = i.GetResultAsync(q2); var r2 = await i2; Console.WriteLine(r2); cl.Reset(); Console.WriteLine("Search 2"); r = cl.RunSearchAsync(); await r; foreach (var result in cl.Results) { Console.WriteLine(result); } }