ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • SSD-VGG
    AI-video&image/Object Detection 2020. 2. 24. 00:16

    1.환경설정

    (tf1) C:\Users\achin>pip install cython contextlib2 matplotlib pillow lxml

     

    2.pycocotools 설치

    pip install pycocotools 

    하지만 아래와 같이 오류가 날수 있음

    ERROR: Failed building wheel for pycocotools

     

     

     

    오류 해결을 위해 https://github.com/cocodataset/cocoapi 사이트에서 api 다운로드 후 해당 파일에 넣어준 후에 cocoapi-master\PythonAPI 파일에 들어가서 하기 코드로 실행했지만 실패

    python setup.py

     

     

     

    구글링을 통해 찾아보니 하기 깃허브를 설치함에 따라 오류를 해결할수 있다는것을 보고 설치했더니 오류 해결

    (원인은 상단의 github주소의 cocoapi는 윈도우와 python3 환경에서 작동이 원활하지 않다고 함)

    pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI

    (또한 Windows에서는 경로에 Visual C ++ 2015 빌드 도구가 있어야 해서 없는 사람은 하기 주소로 다운로드  https://go.microsoft.com/fwlink/?LinkId=691126)

     

     

    3.Protocol Buffer 3.3.0 설치

    Protocol Buffer란 직렬화 데이터 구조로 직렬화,역직렬화를 통해 통신을 빠르게 할수 있음

    하기 사이트에서 protoc-3.3.0-win32.zip다운(여기서 버전이 다르면 오류가 나기 때문에 버전 확인)

    https://github.com/protocolbuffers/protobuf/releases/tag/v3.3.0

     

    (tf1) C:\Users\achin\github\01_Video_Image\ObjectDetection\03SsdVgg>C:\Users\achin\github\01_Video_Image\ObjectDetection\03SsdVgg\protoc-3.3.0-win32\bin\protoc object_detection\protos\*.proto --python_out=.

     

    (tf1) C:\Users\achin\github\01_Video_Image\ObjectDetection\03SsdVgg>C:\Users\achin\github\01_Video_Image\ObjectDetection\03SsdVgg\protoc-3.3.0-win32\bin\protoc

    여기까지가 protoc-3.3.0-win32에서 다운받은 protoc

     

    object_detection\protos\*.proto

    이건 object_detection의 proto

     

     

    그 결과 C:\Users\achin\github\01_Video_Image\ObjectDetection\03SsdVgg\object_detection\protos 파일에 하기와 같이 파일들이 만들어지는것을 볼수 있음(파일 33개-> 65개)

     

     

    4.slim 시스템 변수에 추가

    python으로 시스템 변수 추가

    import sys
    sys.path.append('C:/Users/ 여기에 경로를 추가')

     

    5.tutorial 파일에 나와있듯이 하기 url을 통해 가중치 파일을 다운받을수 있음

    https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

     

    다운을 받은후 압축을 풀어준다

     

     

     

     

    6.pb파일 메모리에 올리기

    'AI-video&image > Object Detection' 카테고리의 다른 글

    Ssd Mobilenet v1, v2 차이점 비교  (0) 2020.02.15
    YOLO V3 웹캠 연결하기  (0) 2020.02.15
Designed by Tistory.