اكتشاف الشعارات على الصور باستخدام Google Cloud Vision API
#1
Detecting Logos On Images Using Google Cloud Vision API

[صورة: starbucks2-9180061.png?resize=768%2C620&ssl=1]

كود :
POST https://vision.googleapis.com/v1/images:annotate { "requests": [ { "features": [ { "type": "LOGO_DETECTION" }], "image": { "source": { "imageUri": "https://images.pexels.com/photos/791942/pexels-photo-791942.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" }}}]} procedure TForm1.Button1Click(Sender: TObject); var APIkey: String; begin FDMemTable1.Active := False; RESTClient1.ResetToDefaults; RESTClient1.Accept := 'application/json, text/plain; q=0.9, text/html;q=0.8,'; RESTClient1.AcceptCharset := 'UTF-8, *;q=0.8'; RESTClient1.BaseURL := 'https://vision.googleapis.com'; RESTClient1.HandleRedirects := True; RESTClient1.RaiseExceptionOn500 := False; //APIkey := 'put here your Google API key'; RESTRequest1.Resource := Format('v1/images:annotate?key=%s', [APIkey]); RESTRequest1.Client := RESTClient1; RESTRequest1.Response := RESTResponse1; RESTRequest1.SynchronizedEvents := False; RESTResponse1.ContentType := 'application/json'; RESTRequest1.Params[0].Value := Format( '{"requests": [{"features": [{"maxResults": %s,"type": "LOGO_DETECTION"}],"image": {'+ '"source": {"imageUri": "%s"}}}]}', [Edit2.text, Edit1.text]); RESTResponse1.RootElement := 'responses[0].logoAnnotations'; RESTRequest1.Execute; memo2.Lines := RESTResponse1.Headers; memo3.Lines.text := RESTResponse1.Content; end;
قل: اللهم فاطِرَ السماوات والأرض عالم الغيبِ والشهادة، ربَّ كُلِّ شَيءٍ ومَلِيكَه، أَشْهد أن لا إله إلا أنت، أعوذ بك من شرِّ نفسي وشرِّ الشيطان وشِرْكِهِ وأن أقترف على نفسي سوءًا أو أجرُّه إلى مسلم
[-] كل من 2 users say قال شكرا ل Delphi4Us على المشاركة المفيدة
  • mobile, haniid
الرد
#2
APIkey ليست مجانية
‏اللّهمّ فرّج أُموراً ضَاقت بها صُدورنا وعجزت بها حيلتنا وقلّ بها صَبرنا الّلهمّ أَسعِد قلوبنا بما أنتَ أعْلَمُ بِهِ مِنّا
[-] كل من 1 user says قال شكرا ل larbiparadox على المشاركة المفيدة
  • Delphi4Us
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم