Related to: Project
GitHub - 404Vector/App.Streamlit-FastAPI.Text.Detector: OCR Task 중 하나인 Text Detection을 수행하는 Web Service 저장소 입니다.
You can’t perform that action at this time.
https://github.com/404Vector/App.Streamlit-FastAPI.Text.Detector
개요
- 목적
- 이 프로젝트는 사용자가 업로드한 이미지에서 Text가 있는 위치를 예측해주는 Web 기반 Service를 개발하는 것이 목적입니다.
- Model, Weight
- Text Region의 예측은 기존에 대회에서 훈련시킨 모델을 가져와 사용했습니다.
- NAVER Connect 학습 데이터 추가 및 수정을 통한 이미지 속 글자 검출 성능 개선
- Web
- Frontend : Streamlit
- Backend : FastAPI
설치 및 실행
-
설치
- 주의 : Python 3.8.15, curl, git-lfs가 필요합니다.
# (optional)curl이 없는 경우 apt-get install curl # (optional)git-lfs가 없는 경우 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash apt install git-lfs # git repos clone git clone https://github.com/404Vector/App.Streamlit-FastAPI.Text.Detector.git cd App.Streamlit-FastAPI.Text.Detector # install package pip3 install -r requirments.txt # or pipenv install -r requirments.txt-
Error Case
ERROR: Could not build wheels for lanms-neo, which is required to install pyproject.toml-based projects→ build-essential 설치 후 다시 시도
(개발에 필요한 기본 라이브러리와 헤더파일이 설치됨)
apt-get install build-essential -y # install package pip3 install -r requirments.txt # or pipenv install -r requirments.txt
-
실행
-
Frontend 실행
python -m frontend -
Backend 실행
python -m backend -
실행화면

-
결과
- Streamlit과 FastAPI를 사용하여 훈련한 모델로 결과를 얻을 수 있었다.
- Web Application을 만들어 본 것은 두 번째여서 Streamlit과 FastAPI 사이의 정보 교환은 공부하며 진행해야 했다.
- Streamlit은 변경사항이 있을 때 마다 rendering을 다시 하며 위에서 아래로 순차적으로 script를 읽기 때문에 state(st.session_state)를 적극적으로 활용해야 작업이 편리했다.
- Frontend와 Backend로 분리되어 있어서 한쪽만 수정해도 되는 작업의 경우 매우 편리했다.