Code Monkey home page Code Monkey logo

adonimages's Introduction

Anomaly Detection using Computer Vision

License

This template is licensed to Customer subject to the terms of the license agreement between Domino and the Customer on file.

About this project

The purpose of anomaly detection via computer vision is to identify and flag instances in visual data that deviate significantly from what is considered normal or expected. Anomalies, also known as outliers, are data points or patterns that differ substantially from the majority of the data, either due to errors, defects, fraud, or any other unusual circumstances. Anomaly detection in computer vision involves leveraging machine learning and image processing techniques to automatically identify such anomalies in images or videos.

In this project, we go through the process of applying anomaly detection for the purposes of quality control and defect detection. We fit a PaDIM model against the MVTecAD dataset using Anomalib, a comprehensive deep learning library designed to serve as a hub for state-of-the-art anomaly detection algorithms.

The assets included in the project are:

anomaly_detection.ipynb - A notebook that walks the user over the process of acquiring the MVTecAD dataset and storing it as a Domino Dataset. It also configures, trains, and runs a test inference call with the PaDIM model. The trained model is also persisted in padim for the purposes of deploying it as a Model API.

score.py - a scoring function that exposes the persisted model as Model API. The score function accepts an image path as an argument and returns a boolean prediction (anomalous or not) and a confidence score of the prediction.

Dockerfile

Please refer to the AI Hub meta data to get information about the environment needed to run this project . Alternately, please create an environment based off of a Domino Standard Environment (DSE), that contains Python 3.9 or above.

Add the following entries to the Dockerfile:

USER ubuntu
RUN pip install --user anomalib==0.6.0 \
    && pip install --user openvino==2023.0.1


RUN pip install --user openvino-dev[pytorch,onnx]==2023.0.1

Don't forget to expose the relevant IDEs as pluggable workspaces, as described in the Domino Documentation.

Model API

The scoring endpoint expects an image path as its input. For this to work, the model version needs to be configured with a Kubernetes volume, where the scored images are uploaded. The call then takes the form of

{
  "data": {
    "image": "[volume]/[image.png]"
  }
}

adonimages's People

Contributors

ddl-danmennell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.