Creating a Startup File
You need to prepare the inference startup file infer_start_cfs.py. The ResNet-50 model is used as an example. The following content is for reference. In the example, run.sh can be downloaded from the ModelZoo. Select a wanted script, obtain from the infer/sdk directory, and store it in the sdk directory of the inference code. Place the infer_start_cfs.py file in the directory at the same level as the main.py file.
import os
import subprocess
from shlex import quote
print("*****************begin infer*******************")
sh_path = "/job/dec/infer/sdk/"
os.chdir(os.path.abspath(sh_path))
print(subprocess.run([quote("./run.sh")], shell=False))
print("******************end infer********************")
Parent topic: Containerized Inference in Edge Scenarios