Overview

Previously, I created tutorials for NDL OCR and NDL Classical Text OCR using Google Cloud Platform and Google Colab.

This time, I will explain how to run NDL Classical Text OCR using Amazon SageMaker Studio. Please note that this method incurs costs during execution.

The description of Amazon SageMaker Studio is available at the following link:

https://aws.amazon.com/jp/sagemaker/studio/

Domain Setup and Other Configuration

For domain setup and other configuration, please refer to articles such as the following:

https://dev.classmethod.jp/articles/how-to-walk-around-amazon-sagemaker-studio-new-ui/

In this guide, I will start from the point where you select “Launch” then “Studio” from the already-created user profile as shown below.

Operations in Studio

There are several ways to launch a notebook, but here we will use “File” -> “New” -> “Notebook.”

After that, a dialog like the following appears, and for this time we select “ml.g4dn.xlarge.”

Running !nvidia-smi will display a Tesla T4.

Running the Notebook

Download the following notebook file and upload it to SageMaker.

https://github.com/nakamura196/ndl_ocr/blob/main/sagemaker_ndl_kotenseki_ocr.ipynb

The notebook was created with reference to @blue0620’s notebook.

https://github.com/blue0620/NDLkotenOCR-GoogleColabVersion/blob/main/NDLkotensekiOCR_googlecolabversion.ipynb

A major difference from the above is that the following commands are executed first. Without these, errors such as error: command 'gcc' failed with exit status 1 will occur during library installation.

!!!aaappptttu--pyydaiitnnessttaallllbluiiblgdl-1e-smseesnat-idaelvlibglib2.0-0

The OCR processing is executed as shown below.

Deleting the Instance

After execution, be sure to delete the instance. For example, shut down the instance from “Running Terminals and Kernels” -> “Running Instances” on the left side of the screen.

Summary

I have explained how to run NDL Classical Text OCR using Amazon SageMaker Studio.