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

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

matuyuji
January 23, 2016

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

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

matuyuji

January 23, 2016
Tweet

More Decks by matuyuji

Other Decks in Programming

Transcript

  1. %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 } ] }
  2. %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 } ] }
  3. %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 } ] }
  4. %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 } ] }
  5. %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 } ] },
  6. %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 }
  7. ը૾ೝࣝαʔϏε ·ͱΊ w $MBSJGBJ
 ը૾ͱಈըͷλά࡞੒ w .JDSPTPGU1SPKFDU0YGPSE7JTJPO"1*T
 0$3ɺը૾ΧςΰϦɺإೝࣝɺಉҰਓ෺൑ఆɺ೥ྸੑผ൑ɺʜ w %PDPNP%FWFMPQFS4VQQPSUը૾ೝࣝ"1*


    ը૾ೝࣝɺը૾ΧςΰϦɺ঎඼ೝࣝɺإೝࣝɺʜ w (PPHMF$MPVE7JTJPO"1*
 0$3ɺը૾ΧςΰϦɺإೝࣝɺϩΰೝࣝɺϥϯυϚʔΫೝࣝɺʜ
  8. $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, … ] } }
  9. 4BNQMF function reverseArray(array) local reversed = {} for idx, val

    in ipairs(array) do reversed[#array - idx + 1] = val end return reversed end
  10. -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
  11. -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 }
  12. 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)
  13. 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 );
  14. ը૾ೝࣝαʔϏε ·ͱΊ w $MBSJGBJ
 ը૾ͱಈըͷλά࡞੒ w .JDSPTPGU1SPKFDU0YGPSE7JTJPO"1*T
 0$3ɺը૾ΧςΰϦɺإೝࣝɺಉҰਓ෺൑ఆɺ೥ྸੑผ൑ɺʜ w %PDPNP%FWFMPQFS4VQQPSUը૾ೝࣝ"1*


    ը૾ೝࣝɺը૾ΧςΰϦɺ঎඼ೝࣝɺإೝࣝɺʜ w (PPHMF$MPVE7JTJPO"1*
 0$3ɺը૾ΧςΰϦɺإೝࣝɺϩΰೝࣝɺϥϯυϚʔΫೝࣝɺʜ