CRAFT は,文字検出の一手法.
【目次】
【文献】
Youngmin Baek, Bado Lee, Dongyoon Han, Sangdoo Yun, and Hwalsuk Lee, Character Region Awareness for Text Detection, Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9365--9374, 2019.
【関連する外部ページ】
GitHub のページ: https://github.com/clovaai/CRAFT-pytorch
Gitは,バージョン管理システム.ソースコードの管理や複数人での共同に役立つ.
【サイト内の関連ページ】
Windows での Git のインストール: 別ページ »で説明している.
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
【サイト内の関連ページ】
【関連する外部ページ】
Python の公式ページ: https://www.python.org/
【サイト内の関連ページ】
NVIDIA グラフィックスボードを搭載しているパソコンの場合には, NVIDIA ドライバ, NVIDIA CUDA ツールキット, NVIDIA cuDNN のインストールを行う.
【関連する外部ページ】
コマンドプロンプトを管理者として実行: 別ページ »で説明
PyTorch のページ: https://pytorch.org/index.html
次のコマンドは, PyTorch 2.0 (NVIDIA CUDA 11.8 用) をインストールする. 但し,Anaconda3を使いたい場合には別手順になる.
事前に NVIDIA CUDA のバージョンを確認しておくこと(ここでは,NVIDIA CUDA ツールキット 11.8 が前もってインストール済みであるとする).
PyTorch で,GPU が動作している場合には,「torch.cuda.is_available()」により,True が表示される.
python -m pip install -U --ignore-installed pip python -m pip install -U torch torchvision torchaudio numpy --index-url https://download.pytorch.org/whl/cu118 python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
Anaconda3を使いたい場合には, Anaconda プロンプト (Anaconda Prompt) を管理者として実行し, 次のコマンドを実行する. (PyTorch と NVIDIA CUDA との連携がうまくいかない可能性があるため,Anaconda3を使わないことも検討して欲しい).
conda install -y pytorch torchvision torchaudio pytorch-cuda=11.8 cudnn -c pytorch -c nvidia py -c "import torch; print(torch.__version__, torch.cuda.is_available())"
【サイト内の関連ページ】
【関連する外部ページ】
コマンドプロンプトを管理者として実行: 別ページ »で説明
pip install -U opencv-python scikit-image scipy cd %HOMEPATH% rmdir /s /q CRAFT-pytorch git clone --recursive https://github.com/clovaai/CRAFT-pytorch
https://github.com/clovaai/CRAFT-pytorch の「Test instruction using pretrained model」のところ
General を選んでみる
動作確認のために使用する画像ファイルは https://github.com/clovaai/deep-text-recognition-benchmark で公開されている画像ファイルを使うことにする.
cd %HOMEPATH% rmdir /s /q deep-text-recognition-benchmark git clone --recursive https://github.com/clovaai/deep-text-recognition-benchmark
cd %HOMEPATH% cd CRAFT-pytorch python test.py --trained_model=craft_mlt_25k.pth --test_folder=%HOMEPATH%\deep-text-recognition-benchmark\demo_image