Running Roboflow Inference
Run Roboflow inference from ALPON X5 AI or ALPON X4 through ALPON Cloud: create a Roboflow workflow, package a small inference-sdk client in an ARM64 container, push it to the Sixfab Container Registry, and deploy it with your Roboflow API key, workspace, and workflow ID.
Deploy Roboflow Inference on ALPON
Run AI-based image inference from your ALPON X5 AI or ALPON X4 with
Roboflow. This guide creates a Roboflow workflow, packages a small
inference-sdk client in an ARM64 container that sends images to the Roboflow hosted API,
and deploys it through ALPON Cloud so it runs continuously on the device.
Create a workflow in Roboflow and copy its API key, workspace name, and workflow ID. Build an ARM64
container that uses the Roboflow inference-sdk to send an image to the hosted API, push it to
your Sixfab Container Registry, then use the Applications → Deploy panel on
ALPON Cloud to launch it on your ALPON X5 AI or ALPON X4
with the ROBOFLOW_API_KEY, ROBOFLOW_WORKSPACE, and ROBOFLOW_WORKFLOW_ID
environment variables. Inference results appear in the container logs.
Overview
Roboflow is a computer vision platform for building, training, and deploying image models and workflows. This guide sends images from a container on an ALPON X5 AI or ALPON X4 to the Roboflow hosted API and returns inference results. Processing is remote rather than on-device, so latency, data handling, usage limits, and availability depend on the network and your Roboflow plan.
The application workflow is simple: the app is dockerized, the container is deployed to the ALPON via ALPON Cloud, and the deployed application runs continuously on the device. The steps below are identical on ALPON X4 and ALPON X5 AI.
Hosted inference requires an internet connection with enough upstream bandwidth for the submitted images. Review the Roboflow API's current authentication, privacy, and rate-limit documentation before production use.
You need an ALPON X5 AI or ALPON X4 registered on ALPON Cloud with internet access, a Roboflow account, and Docker installed on your build machine to build and push the image. New to container deployment? Start with Containerize Apps for ALPON.
-
1
Create a workflow in Roboflow
Go to app.roboflow.com and sign up or log in. In the left menu, select Workflows → Create a Workflow.
Workflows → Create a Workflow in the Roboflow left menu. Add a model by clicking Add a Model, then select Object Detection model.
Click Add a Model in the workflow editor.
Select Object Detection model. Add a model by clicking Browse Pre-trained Models, then select YOLOv8.
Click Browse Pre-trained Models.
Select YOLOv8 from the pre-trained models. Save the workflow.
Save the workflow. Go to Settings → API Keys and copy your API key.
Open Settings → API Keys.
Copy your Roboflow API key. In the workflow view, click Deploy to see the required environment variables — the workspace name and workflow ID. You’ll need them in step 5.
The Deploy panel lists the workspace name and workflow ID. -
2
Write the Roboflow inference app
Package your Roboflow client as a Docker container. Create a directory on your build machine with the following
Dockerfileandmain.py:DockerfileFROM python:3.11-slim WORKDIR /app RUN pip install --no-cache-dir inference-sdk COPY main.py . CMD ["python", "main.py"]
python · main.py# main.py import os import time from inference_sdk import InferenceHTTPClient API_URL = os.getenv("ROBOFLOW_API_URL", "https://serverless.roboflow.com") API_KEY = os.getenv("ROBOFLOW_API_KEY") WORKSPACE_NAME = os.getenv("ROBOFLOW_WORKSPACE") WORKFLOW_ID = os.getenv("ROBOFLOW_WORKFLOW_ID") IMAGE_PATH = os.getenv("IMAGE_PATH", "/data/image.jpg") if not all([API_KEY, WORKSPACE_NAME, WORKFLOW_ID]): raise EnvironmentError("Missing required environment variables.") client = InferenceHTTPClient(api_url=API_URL, api_key=API_KEY) while True: try: result = client.run_workflow( workspace_name=WORKSPACE_NAME, workflow_id=WORKFLOW_ID, images={"image": IMAGE_PATH}, use_cache=True ) print("Inference result:", result) except Exception as e: print("Error during inference:", e) time.sleep(60)
Image inputs onlyThe Roboflow API supports only image inputs. If you want to use a video or live feed, you must extract frames and send them one by one (edge inference is not available on ALPON X4).
You may also modify the code to use a USB camera via
cv2.VideoCapture(), though this is not officially supported in the cloud-based flow. -
3
Build the container image
In the folder containing your
Dockerfileandmain.py, build the image for the device’sarm64architecture:bash · build the imagedocker buildx build --platform linux/arm64 --load -t roboflow-inference .
-
4
Add the Roboflow inference container
Make the
roboflow-inferenceimage available to your device by pushing it to your Sixfab Container Registry, so deployments are fast and repeatable. Log in to Sixfab Registry, click + Add Container, and follow the prompts to push theroboflow-inferenceimage.Pushing images to the Sixfab Container RegistryFor the full walkthrough of tagging and pushing an image, see Update Containers from the Sixfab Container Registry.
-
5
Deploy the container on ALPON
Open your device in ALPON Cloud, go to the Applications section, and click + Deploy. In the Deploy Container window, use these settings:
Container Nameroboflow-inference(or your preferred name)ImageTheroboflow-inferenceimage and tag you pushed to the Sixfab Container Registry.EnvironmentClick + Add More in the Environment section and add the variables in the table below, with the values from your Roboflow workspace and workflow (step 1).Key Value Description ROBOFLOW_API_KEYYour Roboflow API key API key from Roboflow Settings → API Keys ROBOFLOW_WORKSPACEYour Roboflow workspace name From your Roboflow account ROBOFLOW_WORKFLOW_IDYour Roboflow workflow ID From your Roboflow Workflow configuration ROBOFLOW_API_URLOptional, default https://serverless.roboflow.com Roboflow API base URL (optional) IMAGE_PATHPath to input image on device E.g., /data/image.jpg(optional)Click + Deploy to launch the Roboflow inference container on the device.
-
6
Check the deployment and inference results
Once the deployment completes, the
roboflow-inferencecontainer is running on the target ALPON device and sends the image to the Roboflow hosted API every 60 seconds. Check the Applications tab in ALPON Cloud for real-time status, and open the container logs to see each result:ALPON Cloud · container logsInference result: [{ ... }]If the log shows
Missing required environment variables., check the three required variables from step 5; if it showsError during inference:, confirm the device has internet access and that the image exists atIMAGE_PATH.
- The
roboflow-inferencecontainer shows as running in the Applications section. - The container logs print
Inference result:with predictions from your Roboflow workflow.
Your Roboflow inference application is now running continuously on the ALPON. Adjust
main.py to feed it your own images or camera frames.
Production image policy: Replace floating
:latestreferences with a reviewed immutable tag or digest, then record the selected version for rollback.
Updated 1 day ago
