Wantedly Peopleのスキャン画面の裏側 / Wantedly People Scanning Screen

Wantedly Peopleのスキャン画面の裏側 / Wantedly People Scanning Screen

2017/05/31 Wantedly技術見学会 iOS編

3652e140db258288623a0adf248baec0?s=128

Shinichi Goto

May 31, 2017
Tweet

Transcript

  1. Wantedly Peopleͷ εΩϟϯը໘ͷཪଆ ɹ 2017/05/31 Wantedlyٕज़ݟֶձ iOSฤ shingt (Shinichi Goto)

    @ Wantedly, Inc.
  2. shingt (Shinichi Goto) GitHub: @shingt Twi5er: @_shingt

  3. None
  4. None
  5. Outline • εΩϟϯը໘ͷॲཧͷྲྀΕ • ٕज़ཁૉ / ߏ੒ • ෆ҆ఆͳݕग़݁Ռ΁ͷରॲ •

    σόοά൛ͷ࿩
  6. εΩϟϯը໘ͷॲཧͷྲྀΕ

  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. ٕज़ཁૉ / ߏ੒

  18. • AVFounda*on • OpenCV • ίϯϐϡʔλϏδϣϯ༻ͷϥΠϒϥϦ • ໊ࢗྖҬͷݕग़ɺͦͷଞը૾ॲཧʹར༻ • ಛผͳ΋ͷ͸࢖͍ͬͯͳ͍

  19. ໊ࢗݕग़ͷOpenCVҎ֎ͷબ୒ࢶ • CoreImage • Accerelate (BNNS) • Metal (CNN) •

    TensorFlow
  20. ݕग़ϩδοΫ͸Androidͱڞ௨Խ͍ͨ͠ ʢগͳ͘ͱ΋ॳظϦϦʔεͰ͸ʣ

  21. => Accerelate / Metal / CoreImage ͸ݟૹΓ ʢલऀ2ͭ͸iOS9Ͱར༻Ͱ͖ͳ͍໰୊΋ʣ

  22. TensorFlow • ΞϓϦʹ૊ΈࠐΈɺผ్ֶशࡁͷϞσϧΛద༻ɺͱ͍͏ͱ͜Ζ ·Ͱ͸ࢼͨ͠ • ໊ࢗݕग़෦෼΁ͷ࣮ࡍͷ׆༻ʹ͸ࢸΒͣ • ։ൃظؒɺσʔληοτɺਫ਼౓ͷ໰୊

  23. ༨ஊ: Google I/O '17 pod 'TensorFlow-experimental' ɹ • Android Meets

    TensorFlow: How to Accelerate Your App with AI • "experimental" Ͱͳ͍ํ͸ "Coming soon" ͱͳͬͯΔ • h?ps:/ /cocoapods.org/pods/TensorFlow
  24. ߏ੒

  25. ɹ • OpenCV • C++Ͱهड़͞ΕͨΠϯλʔϑΣΠεΛར༻ • => Swi/͔Βͷ௚઀ͷݺͼग़͠͸ෆՄ • ʢඞવతʹʣݕग़ؔ࿈ͷϩδοΫ͸Objec3ve-C++ଆʹدͤΔ

  26. None
  27. // CardDetector.mm - (NSArray<CardFeature *> *)cardFeaturesInMat:(const cv::Mat &)mat { std::vector<dtct::Card>

    cards = ... // Detect cards on C++ layer NSMutableArray<CardFeature *> *cardFeatures = [NSMutableArray array]; for (const auto& card : cards) { if (!card.is_namecard) continue; CardFeature *cardFeature = [[CardFeature alloc] initWithDTCTCard:card]; [cardFeatures addObject:cardFeature]; } return cardFeatures; }
  28. CardDetector • C++ͷϨΠϠ΁ͷProxyʹ͍ۙҐஔ • ࣮ࡍʹ͸͋Δఔ౓ը૾ॲཧϩδοΫ΋ؚΉ • ࠲ඪิਖ਼ɺಁࢹม׵ɺetc. • σόΠεଆͰಈ͔ͯ͠ΈͯॳΊͯݟ͔ͭΔɺͱ͍͏໰୊΋͋ͬ ͨͨΊ

  29. C++ͷϨΠϠ • ੾Γग़ͯ͠։ൃ & ୯ಠͰϏϧυ • ΞϓϦશମΛϏϧυ͢Δͷʹൺ΂ͯѹ౗తʹ଎͍ͨΊ • ݕग़෦෼ͷϩδοΫΛվળ͠΍͍͢ʢ΋ͬͱجຊతͳ෦෼͸ PythonͰ࣮ݧʣ

    • దٓiOSϓϩδΣΫτ΁औΓࠐΈ
  30. ෆ҆ఆͳݕग़݁Ռ΁ͷରॲ

  31. ໊ࢗྖҬͷݕग़

  32. AVCaptureStillImageOutput ʢ੩ࢭը༻ʣ OR AVCaptureVideoDataOutputʢಈը༻ʣ

  33. ໊ࢗεΩϟϯʹγϟολʔԻ͸໐Βͨ͘͠ͳ͍ => AVCaptureVideoDataOutput

  34. ໰୊: iPhone͸༳ΕΔ

  35. => ϒϨΔ

  36. None
  37. ղܾࡦ: γʔέϯεͱͯ͠ѻ͏

  38. None
  39. None
  40. None
  41. None
  42. ݕग़݁Ռͷ౤ථ • ϑϨʔϜͷ઱໌౓ʢͲΕ͚ͩϒϨ͍ͯͳ͍͔ʣ • ϥϓϥγΞϯϑΟϧλΛ͔͚ͨ݁Ռͷ෼ࢄʢͰ͋Δఔ౓ݟΕ Δʣ • ݕग़໊ࢗຕ਺ • ͲΕ͚ͩ௚ۙͷϑϨʔϜ͔

  43. ࢀߟ: ઱໌౓ͷԋࢉ @implementation UIImage (CVExtension) - (double)sharpness { cv::Mat mat,

    gray, laplacian; UIImageToMat(self, mat); cv::cvtColor(mat, gray, CV_BGR2GRAY); cv::Laplacian(gray, laplacian, CV_64F); cv::Scalar mean, stddev; cv::meanStdDev(laplacian, mean, stddev, cv::Mat()); return stddev.val[0] * stddev.val[0]; } @end
  44. None
  45. None
  46. τϥοΩϯά࣌

  47. None
  48. None
  49. None
  50. ɹ • ݁ߏ҆௚ͳղܾࡦͰ͸͋Δ • ͱ͸͍͑ܶతʹମݧ͸޲্ !

  51. σόοά൛ͷ࿩

  52. ϦΞϧλΠϜͳը૾ॲཧΞϓϦͷ։ൃͰࠔΔ͜ͱ • ໰୊ൃੜ࣌ɺݱঢ়೺Ѳʹ͕͔͔࣌ؒΓ΍͍͢ • ϓϩηεͷͲͷ෦෼͕ѱ͍ͷ͔ • ઢ෼ݕग़ʁ࠲ඪม׵ʁ઱໌౓ͷԋࢉʁ

  53. Debug, QAͰ͸ • ԋࢉঢ়گɺϦιʔεঢ়گΛදࣔ • ઱໌౓, γʔέϯεॲཧ, CPU, etc. •

    ը૾ॲཧͷաఔΛදࣔ
  54. None
  55. None
  56. None
  57. ɹ • ࢹ֮తʹ෼͔Γ΍͍ͨ͢Ί໰୊Λݟ͚ͭ΍͍͢ • ͍͚ͦ͏ײ͕CEOʹ఻ΘΔ

  58. ·ͱΊ • εΩϟϯը໘ͷॲཧͷྲྀΕ / ٕज़ཁૉ / ߏ੒ Λ঺հ • ෆ҆ఆͳݕग़݁Ռ΁ͷରॲ

    => γʔέϯεຖʹॲཧ • "ΊͪΌͪ͘ΌεϚʔτʂ" ͳ͜ͱ͸ͯ͠ͳ͍ʢݱঢ়͸ʣ • Debug/QA൛ͰॲཧաఔɺϦιʔεঢ়گΛग़͓ͯ͘͠ • ࢒Γ͸ޙ೔BlogͰެ։ʢ͢Δ͔΋ʣ
  59. Thanks!