ML Model Deployment Tools: Shipping Classical and Deep CV Stages to Production

ML model deployment for computer vision means shipping the whole chain: classical OpenCV stages and the deep model, packaged, versioned and rolled back…

ML Model Deployment Tools: Shipping Classical and Deep CV Stages to Production
Written by TechnoLynx Published on 11 Jul 2026

When teams shop for ML model deployment tools (Triton, TorchServe, BentoML, KServe, ONNX Runtime), they picture wrapping one trained deep model. A production computer vision pipeline is rarely one model. It is a chain: a region-of-interest crop, a classical feature pass such as ORB, SIFT or HOG, the CNN or ViT, and sometimes a classical classifier on top. So ML model deployment for vision comes down to three decisions, made in this order: which serving runtime runs the deep stage, how the whole chain gets packaged as one versioned artefact, and how new versions ship and roll back.

The classical stages are OpenCV and NumPy code, not weights in a framework file, so a tool that expects a model artefact has nowhere obvious to put them. Treat the chain as the thing you deploy, the way a modular computer vision pipeline is designed in the first place.

What ML Model Deployment Tools Cover in the MLOps Pipeline

MLflow’s documentation defines a model deployment pipeline as an automated, repeatable workflow that packages a trained model, validates it against quality gates and promotes it through staging into production, keeping every version traceable and reversible. It lists six stages: data versioning, training and experiment tracking, CI/CD for pipeline code, packaging, model registry and staging, and production serving with observability. Serving tools cover production serving, and some (BentoML, TorchServe) also handle packaging. The model registry and staging are a separate stage of that pipeline.

Google Cloud’s MLOps guidance makes the same point from the other side: in ML systems, deployment is not as simple as putting an offline-trained model behind a prediction service, because you may need to deploy a multi-step pipeline. Sculley et al. (NeurIPS 2015) warned that only a small fraction of the code in many ML systems does learning or prediction, and that data preparation tends to grow into “pipeline jungles” that are costly to test and recover. In a vision system, the classical preprocessing chain is exactly where that jungle grows if nobody owns its packaging.

Triton, TorchServe, ONNX Runtime, BentoML and KServe Compared

The five tools below do different jobs. Two are servers for deep models, one is a runtime, one is a Python packaging and composition framework, and one is a Kubernetes serving layer.

Tool What it is Packaging unit Where classical CV code can live Watch out for
NVIDIA Triton Inference Server Server for models from any framework, on CPU or GPU, over HTTP/REST and gRPC, with a C API for embedding at the edge Model repository; standard image supports PyTorch, TensorRT, ONNX and OpenVINO models Python backend model.py plus config.pbtxt; Business Logic Scripting for custom logic between model calls Python backend spawns one process per model instance because of the GIL
TorchServe Wraps PyTorch models in REST APIs .mar archive, a zip of weights and metadata Custom handler with preprocess, inference and postprocess hooks Project is in limited maintenance, with no planned bug fixes or security patches
ONNX Runtime Runtime that runs ONNX models through hardware execution providers .onnx graph ONNX Runtime Extensions custom operators for vision pre- and post-processing Not a server; you still need an API layer around it
BentoML Python framework for building and packaging AI services Bento: source code, dependencies, model artefacts and configuration Sequential services, where one stage’s output feeds the next General-purpose frameworks measured slower than DL-specific servers (below)
KServe Kubernetes custom resource for serving predictive and generative models InferenceService InferenceGraph pipelines for pre- and post-processing and multi-model workflows Canary rollout is supported only in serverless mode

The experimental evaluation “On the Cost of Model-Serving Frameworks” (arXiv 2411.10337) found that the DL-specific servers, TensorFlow Serving and TorchServe, showed significantly lower latencies than the general-purpose BentoML, MLflow and MLServer. In its image classification scenario, minimum inference times were around 0.07 s for TensorFlow Serving and around 0.21 s for TorchServe. Read those numbers with their limits. All four test models were built in TensorFlow, TorchServe ran them converted to PyTorch format, and the authors give that as a possible reason for TensorFlow Serving’s lead. The study covers serving runtimes in containers, not Kubernetes platforms. It also tests deep models only, so it says nothing about where a SIFT pass or an SVM should run. And TorchServe’s limited-maintenance status matters more for a new build than a latency gap does.

How Do You Deploy a Machine Learning Model Built in Python, from a Trained Artifact to a Production Endpoint?

Getting from a trained artifact to a production endpoint means packaging, validating and promoting it as a versioned, traceable service. Saving the weights is only the first step. MLflow’s guidance, citing Anaconda’s, says it directly: packaging alone isn’t deployment, because the artefact still needs orchestration, an API layer and monitoring hooks. The sequence below runs in order:

  1. Export the deep stage to a format the target runtime loads. ONNX if you want framework independence. SavedModel if you are staying with TensorFlow Serving.
  2. Write the preprocessing as importable code, not notebook cells. The serving tool then calls the same functions that produced the training features.
  3. Pin the environment. Pickle, joblib and cloudpickle artefacts need the same package versions as the training environment, and scikit-learn’s documentation says none of them load a model trained with a different scikit-learn version.
  4. Build a container image that freezes the environment and dependencies.
  5. Verify the target before you deploy. Check that the required packages, memory, compute and accelerators are available in the serving environment.
  6. Test the prediction service through its API with expected inputs. This catches a new model version that expects a different input.
  7. Register the version and deploy through the release path described further down.

A discrepancy in feature generation between training and serving is one of the things a model deployment pipeline has to test for, in addition to the code.

When a Full Model-Serving Platform Is Overkill

For one CV stage, on one target, at moderate traffic, a FastAPI app in a Docker container is often enough. FastAPI’s documentation describes building a Linux container image as the common deployment approach, and the same image runs under Docker, Kubernetes or a cloud container service. On Kubernetes, the guidance is a single Uvicorn process per container, with replication left to the cluster. When an ML model holds a lot of memory, it also advises checking consumption and adjusting how many containers run per machine.

A platform fits teams running many models with varied resource profiles who need fine-grained canary and blue-green rollout control. MLflow’s guidance gives exactly that profile for Kubernetes, and notes the real operational overhead that comes with it.

How Do You Deploy a Classical OpenCV Feature-Extraction Stage That a Model-Serving Tool Won’t Package?

To deploy a classical OpenCV stage, give it a code-execution slot inside the serving tool, run it as its own service, or add it to the ONNX graph as custom operators. Which one fits depends on how your team already runs things.

  • Inside the deep model’s server. Triton’s Python backend lets you serve Python code without writing C++. Its preprocessing example shows that use. Business Logic Scripting lets that Python model call other models served by Triton, with loops and conditionals in between. TorchServe custom handlers run your preprocessing script before inference.
  • As a separate service in a composed pipeline. BentoML can chain services in sequence, and its documentation advises splitting models into separate services when they need independent scaling or different hardware. On Kubernetes, KServe’s InferenceGraph composes pre- and post-processing with the model.
  • Inside the ONNX graph. ONNX Runtime Extensions adds pre- and post-processing custom operators to an ONNX model. This can be done through a pipeline API, a PyTorch export, a custom op node, or composition with existing ONNX graphs. It works when your operations are covered. A bespoke SIFT-plus-ROI heuristic usually is not, and then this route stops being the easy one.
  • As native code. On a constrained edge device, rewriting the classical stage in C++ against OpenCV and linking it to an embedded runtime is often the cleanest option. Triton’s C API exists for this embedding case.

How we would choose: a team already running Triton for the GPU model adds a Python backend stage. A Kubernetes-native platform team uses KServe’s graph. A small Python-first team gets the most from BentoML’s composition. Two Triton details catch people out. The execution environment’s Python version must match the backend stub. And each Python model instance runs as its own process. Both affect memory sizing on a shared GPU node. If the classical layer itself is unfamiliar ground, our piece on feature extraction and image processing in computer vision covers what those stages compute.

How Do You Package Preprocessing or Feature Code That Isn’t a Serializable Model Artifact so That It Ships with the Model?

Code that isn’t a serialisable model artefact ships with the model when you package it as code with explicitly declared dependencies. Pickling it and hoping for the best is the route that breaks.

The persistence format decides how much environment you drag along. Scikit-learn’s documentation notes that ONNX needs only a runtime and a minimal environment, possibly without Python, while pickle, joblib, cloudpickle and skops.io all need a matching Python environment. Not every model converts to ONNX, and sklearn-onnx does not support most third-party estimators. Cloudpickle can serialise user-defined functions and lambdas that pickle cannot, but it needs the same cloudpickle and library versions at load time. Skops.io is a more secure format than pickle because it only loads types and functions that are trusted.

MLflow, BentoML, TorchServe and Triton each offer a code-plus-model package:

  • MLflow pyfunc. A custom PythonModel can define its own preprocessing methods called from predict. load_context runs once at load, so heavy artefacts are not reloaded per request. pip_requirements pins dependencies, and code_path bundles local modules.
  • BentoML. bentoml build packages the service directory and gives each Bento a unique version. bentoml containerize turns it into a Docker image.
  • TorchServe. The handler script is packaged into the archive, and a requirements file installs extra Python packages.
  • Triton. A conda-pack environment is referenced from the model config. Export PYTHONNOUSERSITE first, or the tarball may miss dependencies.

The serving feature code must match the code that produced training data. A model registered without the exact feature code that produced its inputs cannot be rolled back meaningfully.

How Do Deployment-Tool Choices Preserve the Compute Savings of Splitting a Pipeline into Classical and Deep Stages?

In a hybrid design the CNN pass carries most of the inference cost and the classical classifier adds little, so the deployment should not put a heavyweight serving path in front of the small steps. In practice that means co-locating the classifier with the deep pass, or putting each stage on hardware suited to it.

The measured shape of a hybrid pipeline shows why. In a 2025 waste-classification study (arXiv 2510.21833), a customised ResNet50 extracted features and SVM or logistic-regression classifiers made the decision. CNN feature extraction dominated inference cost at roughly 6 to 10 ms per sample, and the classical classifiers ran at sub-millisecond latency. The gap was a few milliseconds at most: 10.11 ms with SVM against 12.67 ms end to end on one dataset, and under a millisecond either way on the other two. The authors describe the differences as small but reproducible, and as mattering most in high-throughput or edge deployments where features are reused across classifiers. A second study, on construction debris (arXiv 2601.17038), reached 99.45% accuracy with Xception features feeding a linear SVM.

The arithmetic tells you where things go wrong. Feature extraction, not classification, carries the inference cost. The serving benchmark found the same thing on its malware scenario: every framework had a cold start dominated by feature extraction from the input, with no noticeable latency differences between frameworks. So keep the classifier in the same process as the CNN’s output. Give CPU-bound classical preprocessing CPU workers so it does not hold GPU instances. BentoML composition supports running stages on different hardware, and Triton Python models can be set to run on CPU or GPU.

How Do Deployment Tools Connect to CI/CD for Models and a Model Registry so That New Model Versions Ship and Roll Back Safely?

New versions ship and roll back safely when the registry holds every version, CI/CD builds and registers each candidate, and traffic shifts gradually against the last good version. Kreuzberger et al. (2022), writing on MLOps engineering architecture, describe the hand-off: a commit triggers the CI/CD pipeline’s build, test and delivery steps, which push versioned artefacts to an artefact store. The continuous deployment pipeline then builds and tests the model with its serving code and deploys it. Google’s guidance adds that metadata should keep a pointer to the previous trained model for rollback, and it describes automated deployment to test, semi-automated deployment to pre-production, and manual promotion to production.

MLflow’s example flow runs validate, train, test, package, register, a canary at 5% of traffic, and then promote or roll back automatically against baseline metrics. Its advice is also about order. Build the deploy and rollback path first, proved with a dummy model, before adding drift detection or retraining.

The mechanics differ by tool:

  • MLflow registry aliases. Reassigning the champion alias to a new version makes the next load pick it up without changing production code, and pointing it back is the rollback. Model stages are deprecated as of MLflow 2.9.0, so build new workflows on aliases.
  • KServe canary. canaryTrafficPercent splits traffic between the last good revision and the new one. On rollback, 100% of traffic is pinned to the previous healthy revision.

For a hybrid CV chain, the unit that moves through this path has to be the whole chain: preprocessing code, classical classifier and deep model under one version. A canary that swaps the CNN while the old crop logic stays in place is testing a combination nobody trained. Our walkthrough of the stages MLOps adds to a DevOps pipeline shows where these gates sit.

How Do You Match Deployment Tools to Targets: Cloud GPU, CPU Service, or a Low-Power Edge Device?

To match tools to a target, start from the hardware and pick the runtime that reaches it. Then check that the classical stages can run there too.

  • Cloud GPU. Triton supports TensorRT, ONNX, PyTorch and OpenVINO models in its standard image, with Python stages alongside.
  • CPU service. A containerised FastAPI service, or ONNX Runtime, which falls back through an ordered provider list, for example CUDA first, then CPU.
  • Edge. ONNX Runtime’s execution providers abstract CPU, GPU, FPGA and NPU libraries behind one API. ONNX Runtime Extensions runs on Android, iOS and WebAssembly. Triton can be embedded through its C API.

One detail bites on constrained devices: if several execution providers are combined in one ONNX Runtime package, all their dependent libraries must be present in the execution environment.

A model that performs in training is a different artefact from one that performs on the deployment target, and the gap between them should be scoped against a named trigger: a performance ceiling, a target constraint or a lock-in cost. The common failure is deploying without testing against representative production data, as we discuss in applying machine learning in computer vision systems. A worked porting assessment for a CV inference workload shows how such a trigger gets scoped.

Can You Deploy a Machine Learning Model for Free (e.g. Streamlit or Hosted Free Tiers), and What Do Those Options Give up in Production?

Yes, for demos. Streamlit Community Cloud is free and deploys from a GitHub repo. According to a 2026 guide from livemy.app, a hosting vendor that sells an alternative, it comes with roughly 1 GB of memory, sleeps after 12 hours without traffic, allows only one private app and offers no custom domains. The same guide notes that a model held in memory hits that ceiling quickly. Treat its figures as indicative, given who published them.

For client-facing tools, the guide names the sleep page and the subdomain as what pushes people to paid hosting.

The Versioned Unit Is the Chain

Packaging a model is the easy part. The harder judgement is deciding what counts as one release. If the ROI crop, the descriptor pass, the CNN and the classifier carry separate version numbers, every rollback becomes a guess about which combination was last known good. Before you compare tools, settle which stages stay as classical computer vision code and which become served models, and where each one will run. That is an architecture decision, and the tool choice follows from it.

FAQ

What Are Some Alternatives to KServe?

Kreuzberger et al. (2022) list TensorFlow Serving and Seldon among Kubernetes-supported serving frameworks, plus managed endpoints such as AWS SageMaker, Azure ML and Google Vertex AI. Triton and BentoML are further options covered above.

Which Tools Are Used for MLOps?

Tools described in the MLOps literature include Airflow or Kubeflow Pipelines for orchestration, MLflow for tracking, registry and serving, and end-to-end platforms such as SageMaker, Azure ML and Vertex AI.

What Is the Difference Between CI/CD and Continuous Deployment?

CI/CD in the MLOps literature covers continuous integration, delivery and deployment together, carrying out build, test, delivery and deploy steps. Continuous delivery prepares a releasable artefact, while continuous deployment pushes it to production automatically. Google’s example keeps the final production promotion manual.