Overview
In the following article, I introduced an inference app using Hugging Face Spaces and a YOLOv5 model trained on the NDL-DocL dataset.
This app had stopped working, so I fixed it to make it operational again.
https://huggingface.co/spaces/nakamura196/yolov5-ndl-layout
Here are my notes on the changes made during this fix.
Changes
The modified app.py is shown below.
First, due to Gradio version upgrades, I changed gr.inputs.Image to gr.Image and similar updates.
I also modified the code to use the following yolov5 library.
https://pypi.org/project/yolov5/
Furthermore, I updated it to use the model hosted on Hugging Face as follows. (Previously, a locally downloaded model was being loaded.)
yolov5.load(“nakamura196/yolov5-ndl-layout”)
As a result, the model page now shows the Spaces where this model is being used. The model description is currently insufficient and will be updated in the future.
https://huggingface.co/nakamura196/yolov5-ndl-layout
Summary
There are many areas that could be improved, but I hope some parts are helpful as a reference.