Part5에서는 input에서부터 output까지의 pipeline을 구축한다.
즉, image 읽기-->prediction-->prediction을 이용해 image에 BB그리기-->그 image 저장하기 과정을 수행한다는 이야기다.
또한, 실시간으로 이 detector를 작동시키는 방법을 알아볼 것이다.
먼저, detector.py file을 만든다.
conda install pandas로 pandas 설치-ArgParse module을 이용해 detector에 command line argument를 전해 주는 function을 만든다.
-COCO data의 label이 담긴coco.names file 다운받고 data 폴더 만들어서 넣기
-util.py에 load_classes 정의
-util.py에 letterbox_image 정의
util.py에 prep_image 정의-batch마다 detection에 걸린 time 측정
write_results의 output을 내기까지 사이의 시간write_prediction의 output attribute 중 하나는 batch에서 image의 index이다. 이를 imlist에서의 image index로 이용한다.-output의 prediction은 padding image에 따른 상태지, original image에 대한 것이 아님.
output_recast = time.time() 추가$ python detector.py --images dog-cycle-car.png --det det
결과: 실패....net load는 됐는데 person이라고만 계속 나옴;;
detect 실패...로 video/webcam은 진행하지 않기로 함