Upgrade to Pro — share decks privately, control downloads, hide ads and more …

画像認識サービスとLightroomプラグイン

53e469a19bcb4584c87789d237128ca0?s=47 matuyuji
January 23, 2016

 画像認識サービスとLightroomプラグイン

各種画像認識ウェブサービスの紹介と、Lightroom Plugin である LightroomPlugin-ClarifaiTagger の紹介

53e469a19bcb4584c87789d237128ca0?s=128

matuyuji

January 23, 2016
Tweet

Transcript

  1. ը૾ೝࣝαʔϏεͱ -JHIUSPPNϓϥάΠϯ ୈճ$PDPBษڧձؔ੢  !NBUVZVKJ

  2. @matuyuji safx-dev.blogspot.jp

  3. -JHIUSPPN

  4. .PUJWBUJPO w େྔͷࣸਅʹ؆୯ʹΩʔϫʔυΛ෇͚͍ͨ w ը૾ೝࣝαʔϏεͰΩʔϫʔυΛαδΣετ Նɺۭɺ૲ݪ

  5. TBGY-JHIUSPPN1MVHJO$MBSJGBJ5BHHFS

  6. None
  7. None
  8. None
  9. None
  10. 0VUMJOF w ը૾ೝࣝαʔϏε w $MBSJGBJ w 1IPUPTIPQ-JHIUSPPN w -VB-JHIUSPPN1MVHJO w

    -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS
  11. ը૾ೝࣝαʔϏε

  12. ը૾ೝࣝαʔϏε w $MBSJGBJ w .JDSPTPGU1SPKFDU0YGPSE7JTJPO"1*T w %PDPNP%FWFMPQFS4VQQPSUը૾ೝࣝ"1* w (PPHMF$MPVE7JTJPO"1*

  13. $MBSJGBJ IUUQXXXDMBSJGBJDPNEFNP

  14. $MBSJGBJ IUUQXXXDMBSJGBJDPNEFNP

  15. Project Oxford https://www.projectoxford.ai

  16. Demos https://www.projectoxford.ai/demo

  17. 1SPKFDU0YGPSE 'FBUVSF"OBMZTJT https://www.projectoxford.ai/demo/vision#Analysis

  18. 1SPKFDU0YGPSE 'FBUVSF"OBMZTJT https://www.projectoxford.ai/demo/vision#Analysis

  19. 7JTVBM$BUFHPSJFT https://msdn.microsoft.com/en-us/library/mt613446.aspx

  20. 1SPKFDU0YGPSE 0QUJDBM$IBSBDUFS3FDPHOJUJPO https://www.projectoxford.ai/demo/vision#Ocr

  21. 1SPKFDU0YGPSE 0QUJDBM$IBSBDUFS3FDPHOJUJPO https://www.projectoxford.ai/demo/vision#Ocr

  22. Docomo Developer Support https://dev.smt.docomo.ne.jp/?p=docs.api.index

  23. https://dev.smt.docomo.ne.jp/?p=docs.api.page&api_name=image_recognition&p_name=api_usage_scenario#tag01 Docomo Developer Support

  24. %PDPNP%FWFMPQFS4VQQPSU ը૾ೝࣝ"1* TDFOF { "jobId": "234531_K1oapLitRV", "candidates": [ { "tag":

    "Ξ΢τυΞ", "score": 0.5713228583335876 }, { "tag": "෩ܠ", "score": 0.33728981018066406 }, { "tag": "ΰϧϑ", "score": 0.07010752707719803 }, { "tag": "Ֆ", "score": 0.01610233262181282 }, { "tag": "αΠΫϦϯά", "score": 0.001829492044635117 } ] }
  25. %PDPNP%FWFMPQFS4VQQPSU ը૾ೝࣝ"1* TDFOF { "jobId": "234225_kyiT2V5xC4", "candidates": [ { "tag":

    "ધ", "score": 0.7887985706329346 }, { "tag": "ݐ෺", "score": 0.20031100511550903 }, { "tag": "ਫ଒ؗ", "score": 0.0036888555623590946 }, { "tag": "ඈߦػ", "score": 0.003007577732205391 }, { "tag": "Ξ΢τυΞ", "score": 0.0010139134246855974 } ] }
  26. https://dev.smt.docomo.ne.jp/?p=docs.api.page&api_name=image_recognition&p_name=api_usage_scenario#tag01 Docomo Developer Support

  27. %PDPNP%FWFMPQFS4VQQPSU ը૾ೝࣝ"1* qPXFS { "jobId": "235050_8Ctmvg1I7O", "candidates": [ { "tag":

    "ώϚϫϦ", "score": 1 }, { "tag": "ΩΫ", "score": 2.0101849074194433e-8 }, { "tag": "Ψʔϕϥ", "score": 1.301374147333334e-10 }, { "tag": "ΨβχΞʢΫϯγϣ΢ΪΫʣ", "score": 1.2209548649888546e-10 }, { "tag": "όʔϕφ", "score": 3.784880395207857e-12 } ] }
  28. %PDPNP%FWFMPQFS4VQQPSU ը૾ೝࣝ"1* qPXFS { "jobId": "234727_BA4lWTesxp", "candidates": [ { "tag":

    "΢ϝ", "score": 0.9999998807907104 }, { "tag": "ιϝΠϤγϊ", "score": 7.231307819210997e-8 }, { "tag": "ϢΩϠφΪ", "score": 2.8857778389124178e-9 }, { "tag": "Ϙέ", "score": 7.249059130742808e-10 }, { "tag": "αϧεϕϦ", "score": 1.4363262098790464e-12 } ] }
  29. %PDPNP%FWFMPQFS4VQQPSU ঎඼ೝࣝ"1* w ສ݅Ҏ্ͷࢢൢ঎඼ w ॻ੶ $% %7% 57ήʔϜιϑτ 1$ιϑτ

     ৯඼ύοέʔδ
  30. %PDPNP%FWFMPQFS4VQQPSU ঎඼ೝࣝ"1* DE { "recognitionId": "f1c3c7e0-c112-11e5-913e-066c9e757987", "candidates": [ { "score":

    1177.6171875, "itemId": "cd_0001191265", "category": "cd", "imageUrl": "http://ecx.images-amazon.com/images/I/71 "detail": { "format": [ "CD", "Import, from US, CD+DVD" ], "ean13": "0633367400727", "label": "Discipline Us", "itemName": "Red: 40th Anniversary Series (Wdva)", "releaseDate": "2009/10/20", "artist": [ "ΩϯάɾΫϦϜκϯ" ], "discs": "2" }, "sites": [ { "url": "http://books.rakuten.co.jp/rb/12019761/", "imageUrl": "http://thumbnail.image.rakuten.co.jp/@ }, { "url": "http://www.amazon.co.jp/gp/product/B002G "title": "Amazon.co.jp: King Crimson : Red: 40th An "imageUrl": "http://ecx.images-amazon.com/images } ] },
  31. %PDPNP%FWFMPQFS4VQQPSU ঎඼ೝࣝ"1* CPPL { "recognitionId": "ebb27a30-c113-11e5-913e-066c9e75 "candidates": [ { "score":

    2880.04296875, "itemId": "book_0000387348", "category": "book", "imageUrl": "http://ecx.images-amazon.com/ima "detail": { "author": [ "ాத ҆ߦ" ], "isbn10": "4342103702", "isbn13": "978-4342103704", "pages": "796", "itemName": "ϩϯάϚϯActive Studyӳӳࣙయ 3 "releaseDate": "1999/02", "publisher": "ۅݪॻళ", "type": "୯ߦຊ" }, "sites": [ { "url": "http://www.amazon.co.jp/gp/produc "title": "Amazon.co.jp: ϩϯάϚϯActive Stu "imageUrl": "http://ecx.images-amazon.com }, { "url": "http://books.rakuten.co.jp/rb/11696 "imageUrl": "http://thumbnail.image.rakute }, { "url": "http://www.7netshopping.jp/books/d "imageUrl": "http://img.7netshopping.jp/bk }
  32. ը૾ೝࣝαʔϏε ·ͱΊ w $MBSJGBJ
 ը૾ͱಈըͷλά࡞੒ w .JDSPTPGU1SPKFDU0YGPSE7JTJPO"1*T
 0$3ɺը૾ΧςΰϦɺإೝࣝɺಉҰਓ෺൑ఆɺ೥ྸੑผ൑ɺʜ w %PDPNP%FWFMPQFS4VQQPSUը૾ೝࣝ"1*


    ը૾ೝࣝɺը૾ΧςΰϦɺ঎඼ೝࣝɺإೝࣝɺʜ w (PPHMF$MPVE7JTJPO"1*
 0$3ɺը૾ΧςΰϦɺإೝࣝɺϩΰೝࣝɺϥϯυϚʔΫೝࣝɺʜ
  33. 0VUMJOF w ը૾ೝࣝαʔϏε w $MBSJGBJ w 1IPUPTIPQ-JHIUSPPN w -VB-JHIUSPPN1MVHJO w

    -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS
  34. $MBSJGBJ

  35. $MBSJGBJ IUUQXXXDMBSJGBJDPNEFNP ࣸਅͷΩʔϫʔυ

  36. $MBSJGBJ w 'SFF1MBO
 VQUPVOJUTNPOUI VOJUTIPVS w MBOHVBHFTTVQQPSU
 &OHMJTI +BQBOFTF ʜ

    w "1*$MJFOUT4BNQMF$PEF
 1ZUIPO +BWB /PEF(P 0CKFDUJWF$
  37. $MBSJGBJ http://www.clarifai.com/pricing

  38. $MBSJGBJ"1*T w UPLFO0"VUIೝূ w UBHը૾ೝࣝ w GFFECBDLը૾ೝࣝͷվળ w JOGP"1*ͷ৘ใ

  39. $VSM $ curl -H "Authorization: Bearer XXXXXXXXXXXXX" \ -F "encoded_data=@/Users/safx/Umeda.jpg"

    \ https://api.clarifai.com/v1/tag/ { "status_code": "OK", "status_msg": "All images in request have completed successfully.", "meta": {"tag": {"timestamp": 1452094463.514861, "model": "general-v1.3", "config": "34fb1111b4d5f67cf1b8665ebc603704"}}, "results": [{"docid": 34811919134783978551778916056908965247, "status_code": "OK", "status_msg": "OK", "local_id": "", "result": {"tag": { "concept_ids": [“ai_Pf2b7clG", … ], "classes": [“԰಺Ͱ", “ۭߓ”, “Կਓ΋͋Γ·ͤΜ”, “ఱҪ”, “ݱ୅ͷ”, … ], "probs": [0.997933030128479, 0.997094988822937, … ] } }
  40. 0VUMJOF w ը૾ೝࣝαʔϏε w $MBSJGBJ w 1IPUPTIPQ-JHIUSPPN w -VB-JHIUSPPN1MVHJO w

    -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS
  41. 1IPUPTIPQ-JHIUSPPN

  42. -JHIUSPPN

  43. "EPCF1IPUPTIPQ-JHIUSPPN w ࣸਅ؅ཧɺݱ૾ΞϓϦέʔγϣϯ w -VBʹΑΔϓϥάΠϯΛ࡞੒ɺར༻Ͱ͖Δ w $SFBUJWF$MPVEϑΥτάϥϑΟϓϥϯ͕͓ٻΊ΍͍͢ԁʗ݄ http://www.adobe.com/jp/products/photoshop-lightroom.html

  44. -JHIUSPPN1MVHJO

  45. 0VUMJOF w ը૾ೝࣝαʔϏε w $MBSJGBJ w 1IPUPTIPQ-JHIUSPPN w -VB-JHIUSPPN1MVHJO w

    -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS
  46. -VB-JHIUSPPN1MVHJO

  47. -VB w XXXMVBPSH w ݟͨ໨͕1BTDBM෩Ͱɺ001͕ͳ͍/PEFKT w -JHIUSPPN w 4JN$JUZ $JWJMJ[BUJPO7

    w $JTDP :BIBNB
  48. 4BNQMF function reverseArray(array) local reversed = {} for idx, val

    in ipairs(array) do reversed[#array - idx + 1] = val end return reversed end
  49. -JHIUSPPN1MVHJO4%, w -JHIUSPPN4%,(VJEF w "1*3FGFSFODF w 4BNQMF1MVHJOT http://www.adobe.com/devnet/photoshoplightroom.html

  50. -S)UUQ local LrHttp = import 'LrHttp' SomeAPI = {} function

    SomeAPI.foo(param) local headers = { { field = 'Content-Type', value = 'application/x-www-form-urlencoded' }, }; local data = 'somParam=' .. param; local body, reshdrs = LrHttp.post(fooURL, data, headers); if reshdrs.status == 401 then return nil end return body end return SomeAPI
  51. -S7JFX local LrView = import ‘LrView' local f = LrView.osFactory()

    local c = f:row { f:checkbox { title = "Title:", value = true, }, f:edit_field { value = "Untitled Text", } } LrDialogs.presentModalDialog { contents = c }
  52. 0CTFSWBCMF5BCMFCJOE ,70 LrFunctionContext.callWithContext("showCustomDialog", function(context) local f = LrView.osFactory() local props

    = LrBinding.makePropertyTable(context) props.isChecked = false local c = f:row { bind_to_object = props, f:checkbox { title = "Title:", value = LrView.bind "isChecked" }, f:edit_field { value = "Untitled Text", enabled = LrView.bind "isChecked" } } LrDialogs.presentModalDialog { contents = c } end)
  53. 0VUMJOF w ը૾ೝࣝαʔϏε w $MBSJGBJ w 1IPUPTIPQ-JHIUSPPN w -VB-JHIUSPPN1MVHJO w

    -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS
  54. -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS

  55. TBGY-JHIUSPPN1MVHJO$MBSJGBJ5BHHFS

  56. +40/ w ެࣜʹ͸༻ҙ͞Ε͍ͯͳ͍ w ֎෦ϥΠϒϥϦΛ࢖͏
 IUUQSFHFYJOGPCMPHMVBKTPO local JSON = require

    ‘JSON' local json = JSON:decode(body);
  57. 5IVNCOBJM local catalog = LrApplication.activeCatalog(); local photos = catalog:getTargetPhoto(); local

    output_path = LrPathUtils.addExtension(photo.path, 'thumbnail.jpg'); photo:requestJpegThumbnail(400, 400, function(thumbnail, err) local out = io.open(output_path, 'w'); io.output(out); io.write(thumbnail); io.close(out); end );
  58. 0VUMJOF w ը૾ೝࣝαʔϏε w $MBSJGBJ w 1IPUPTIPQ-JHIUSPPN w -VB-JHIUSPPN1MVHJO w

    -JHIUSPPN1MVHJO$MBSJGBJ5BHHFS
  59. ·ͱΊ

  60. ը૾ೝࣝαʔϏε ·ͱΊ w $MBSJGBJ
 ը૾ͱಈըͷλά࡞੒ w .JDSPTPGU1SPKFDU0YGPSE7JTJPO"1*T
 0$3ɺը૾ΧςΰϦɺإೝࣝɺಉҰਓ෺൑ఆɺ೥ྸੑผ൑ɺʜ w %PDPNP%FWFMPQFS4VQQPSUը૾ೝࣝ"1*


    ը૾ೝࣝɺը૾ΧςΰϦɺ঎඼ೝࣝɺإೝࣝɺʜ w (PPHMF$MPVE7JTJPO"1*
 0$3ɺը૾ΧςΰϦɺإೝࣝɺϩΰೝࣝɺϥϯυϚʔΫೝࣝɺʜ
  61. None
  62. ؔ࿈ϦϯΫ w $MBSJGBJ
 IUUQXXXDMBSJGBJDPN
 IUUQTEFWFMPQFSDMBSJGBJDPN w "EPCF%FWFMPQFS$POOFDUJPO
 IUUQXXXBEPCFDPNEFWOFUQIPUPTIPQMJHIUSPPNIUNM