Model Inference Workflow
Period: 04/2021 - 05/2021
Project Name: Model Inference Workflow
GitHub: Go to GitHub
Python Onnxruntime Prefect JSON Keras Skimage Numpy os Pathlib Datetime
What's the Project For?
- Project during the internship at viAct.ai.
- Create a model inference workflow.

Project Description
Given a classification model file in onnx format, the task is to create a model inference workflow in Python.
In the code, I have created a function that takes in an image of a person, preprocess it to the required format, pass it to the classification model, and apply a softmax function on the output which represents the probabilities of a person wearing a helmet, a person without helmet, and undetermined respectively.
In addition to that, I have created a task scheduled at 2am every day using Prefect, which it would first look at the user-specific directories where all the images are located, then perform inference on each of the images found in the directory with the function created, and save the inference results in json format. And in the end, it would move all the processed images to user-specific directories after the inference.
Most Challenging Part of the Project?
I found all parts of it challenging since I had totally no idea what I should do as I received the task from my supervisor. Many of the tools mentioned in the task description are new to me, and I started all from scratch. I was really lost at that time, but eventually, after dividing it into smaller parts (e.g. learning about onnxruntime first, then prefect, then file import and export, ...), I was able to find out a solution for the problem, and accomplished the task in the end. I found it a very fruitful learning experience!