일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- SQL
- 컨트리뷰톤
- LEVEL2
- build
- SWEA
- 파이썬
- 프로그래머스
- MSBuild
- Python
- 휴학
- py
- WebOS
- 컴퓨터비전
- java
- androidstudio
- level4
- 대학원일기
- 대학원
- BFS
- 어렵다
- level3
- git
- 내휴학생활중의아주큰일
- 안드로이드스튜디오
- D3
- 자바
- Github
- Matrix Factorization
- level1
- 다시풀기
- Today
- Total
bit가 눈 앞에서 왔다갔다
컴퓨터 비전 - MaskRCNN 본문
파이썬 버전 | 3.6.0 |
텐서플로우 | 1.15.0 |
환경 | Anaconda3 |
1. Dependency file에 있는 것들을 모두 설치한다.
# dependency file에 있는 설치 리스트 numpy scipy cython h5py Pillow scikit-image tensorflow-gpu==1.5 keras jupyter
tensorflow와 keras를 먼저 설치하고 나머지를 설치한다.
pip install tensorflow-gpu==1.5 pip install keras pip install numpy scipy cython Matplotlib h5py Pillow scikit-image jupyter pandas pip install opencv-python ipython
- Mask R-CNN을 clone한다.
conda install -c anaconda git git clone https://github.com/matterport/Mask_RCNN.git
- Pycocotools 다운로드
Visual C++ Build tools가 설치되어 있어야 한다.
설치 되어 있지 않으면 설치 후에 아래 명령어를 입력한다.
git clone https://github.com/philferriere/cocoapi.git pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
설치가 성공적으로 완료 시 Successfully installed pycocotools-2.0가 뜬다.
- imgaug 다운로드
(imgaug - 이미지 처리를 위한 라이브러리)
git clone https://github.com/aleju/imgaug.git pip install imgaug
- 모델 가중치 파일 다운로드
wget https://github.com/matterport/Mask_RCNN/releases/download/v2.1/mask_rcnn_balloon.h5
mask_rcnn_balloon파일을 깃허브 clone을 통해 생긴 Mask_RCNN 파일에 옮긴다.
- 실행
jupyter notebook # 주피터 노트북 실행
Mask_RCNN/samples로 이동해 demo.ipynb 파일을 연다.
위의 코드를 아래와 같이 변경하면 결과 이미지가 뜬다.
*
참고
Failed to load the native TensorFlow runtime.
라는 에러가 뜬 경우, 여러 원인이 있을 수 있다.
cudnn, cuda, visual c++ build tools 등에 문제가 있을 수 있다.
1) 텐서플로우가 문제였던 경우 - 텐서플로우 재설치
pip3 install tensorflow-gpu==1.5.0
*재설치 하는 텐서플로우 버전에 유의할 것.
(특히 텐서플로우1, 2는 각각 사용하는 함수와 문법이 달라서 교차해서 설치하면 안됨)
2) Visual C++ 패키지 문제의 경우
https://docs.microsoft.com/ko-KR/cpp/windows/latest-supported-vc-redist?view=msvc-170
위 링크에 접속해 Visual C++ 2015-2019 재배포 패키지를 설치한다.
64비트 운영체제 사용 시 x86 x64 모두 설치해야 함.
https://code.visualstudio.com/docs/setup/linux
**
Reference
matterport/Mask_RCNN: https://junha1125.github.io/blog/pytorch-docker-git/2020-09-03-2kerasMask/
'인턴십 > KISTI' 카테고리의 다른 글
KISTI 한달 인턴십 후기, 느낀점 - 전1 (0) | 2022.02.23 |
---|---|
KISTI 한달 인턴십 후기, 느낀점 - 기, 승 (0) | 2022.02.23 |
컴퓨터 비전 - YOLOv3 (0) | 2022.02.22 |
컴퓨터 비전 - Docker, Anaconda3 (0) | 2022.02.18 |
컴퓨터 비전 - 초기 환경 설정 (0) | 2022.02.18 |