kookmin-sw / 2019-cap1-2019_4

Flex Ads to implement advertising system in offline market
MIT License
10 stars 7 forks source link

Python 코드에서 C++ Excutable File 의 실행에 관하여 #52

Closed james-sungjae-lee closed 5 years ago

james-sungjae-lee commented 5 years ago

하나의 Python Code 를 실행시켰을 때, detectnet-camera facenet 과 inotify 코드가 함께 실행되는 편이

하나의 Pipeline 을 이루며 오류 없이 더 잘 실행될 수 있을 것으로 보인다.

이를 위해서 python 의 os 패키지를 사용할 수 있다는 것을 확인하였다.

james-sungjae-lee commented 5 years ago

inotify 객체를 생성한 다음, os.system(./detectnet-camera facenet) 을 이용하여 해결 가능하다

https://stackoverflow.com/questions/2473655/how-to-make-a-call-to-an-executable-from-python-script

하지만, 해당 방법으로 실행해본 결과 facenet 이 실행 종료된 다음, inotify 기능이 작동하는 것으로 보아 적절하게 실행되지 않는 문제가 발생하였다.

동시에 face detection 의 print 결과와 inotify 를 이용한 s3 upload, rekognition 분석 결과가 하나의 bash shell 에서 나타나기 때문에 가독성이 좋지 않다.

해당 이유로 기존과 동일하게 서로 다른 프로그램으로 작동시키도록 한다.