Giter Site home page Giter Site logo

max-scw / baslercameraadapter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 112 KB

Provides a Python-based web-server to connect to a Basler camera (using PyPylon)

License: BSD 3-Clause "New" or "Revised" License

Python 95.94% Dockerfile 4.06%
basler basler-camera camera-api docker docker-container vision-api

baslercameraadapter's Introduction

BaslerCameraAdapter

Provides a Python-based web-server REST API to connect to a Basler camera (using PyPylon)

It uses FastAPI to spin up a minimal web server that wraps the Python-package pypylon in a web-api. (This again wraps the Pylon Camera Software Suite into a Python-package.)

The new sever can be packaged as a virtual (Docker) container. Find released images on DockerHub under https://hub.docker.com/u/maxscw.

Structure

The repository is structured as follows:

BaslerCameraAdapter
+-- docs <- auxiliary files for documentation (basically screenshots)
|-- BaslerCamera.py <- python code to interact with a Basler camera
|-- BaslerCameraAdapter.Dockerfile  <- Dockerfile for camera service
|-- docker-compose.yml  <- exemplatory docker-compose call
|-- LICENSE
|-- main.py  <- fastAPI server to communicate with the Basler camera
|-- README.md
|-- requirements.txt  <- pip requirements
|-- utils_env_vars.py <- helper functions that provide the ability to configure the server

Usage

The default entrypoint (/) provides basic information but rather just assures that the server is up.

BaslerCameraAdapter_Entrypoint1.jpg

See docs (endpoint /docs) for details. This endpoint is the charm of FastAPI.

BaslerCameraAdapter_docs.jpg

The documentation is automatically created with Swagger and provides and overview of all available endpoints as well as the ability to try them out with a convenient interface.

BaslerCameraAdapter_docs_take_photo.jpg

Installation

Python

python ./main.py

or use uvicorn directly (always assuming that all package requirements.txt are installed)

uvicorn main:app --host=0.0.0.0 --port=5051

Docker

Use a virtualization engine like docker or podman:

docker build --tag=camera-adapter -f BaslerCameraAdapter.Dockerfile .

or the corresponding compose plugins on the example file (docker-compose.yml):

docker compose up -d

See example file for configuration options via environment variables.

Acknowledgments / Disclaimer

This project is no official project of Basler. It relies on the official pypylon package which is available under the BSD 3-Clause License.

Author

  • max-scw

Status

active

baslercameraadapter's People

Contributors

max-scw avatar

Stargazers

 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.