Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Actcast Application Framework

Project description

Actcast Application Framework for Python

This package provides a Python API for developing Actcast apps.

Installation

for Raspberry Pi

sudo apt-get update
sudo apt-get install -y python3-pil python3-setuptools python3-wheel picamera
pip3 install .

Usage

Construct your application with a task parallel model

  • Application
    • actfw.Application : Main application
  • Workers
    • actfw.task.Producer : Task generator
      • actfw.capture.PiCameraCapture : Generate CSI camera capture image
      • actfw.capture.V4LCameraCapture : Generate UVC camera capture image
    • actfw.task.Pipe : Task to Task converter
    • actfw.task.Consumer : Task terminator

Each worker is executed in parallel.

User should

  • Define subclass of Producer/Pipe/Consumer
class MyPipe(actfw.task.Pipe):
    def proc(self, i):
        ...
  • Connect defined worker objects
p  = MyProducer()
f1 = MyPipe()
f2 = MyPipe()
c  = MyConsumer()
p.connect(f1)
f1.connect(f2)
f2.connect(c)
  • Register to Application
app = actfw.Application()
app.register_task(p)
app.register_task(f1)
app.register_task(f2)
app.register_task(c)
  • Execute application
app.run()

Please, see and try examples.

Example

  • example/hello : The most simple application example
    • Use HDMI display as 640x480 area
    • Capture 320x240 RGB image from CSI camera
    • Draw "Hello, Actcast!" text
    • Display it as 640x480 image (with x2 scaling)
    • Notice message for each frame
    • Support application setting
    • Support application heartbeat
    • Support "Take Photo" command
  • example/grayscale : Next level application example
    • Use HDMI display as 640x480 area
    • Capture 320x240 RGB image from CSI camera
    • Convert it to grayscale
    • Display it as 640x480 image (with x2 scaling)
    • Notice message for each frame
    • Support application setting
    • Support application heartbeat
    • Support "Take Photo" command
  • example/parallel_grayscale : Paralell processing application example
    • Use HDMI display as 640x480 area
    • Capture 320x240 RGB image from CSI camera
    • Convert it to grayscale
      • There exists 2 converter task
      • Round-robin task scheduling
    • Display it as 640x480 image (with x2 scaling)
    • Notice message for each frame
      • Show which converter processes image
    • Support application setting
    • Support application heartbeat
    • Support "Take Photo" command
  • example/uvccamera : UVC camera capture example
    • picamera is unnecessary
    • Use HDMI display center 640x480 area
    • Capture 320x240 RGB image from UVC camera
    • Convert it to grayscale
    • Display it as 640x480 image (with x2 scaling)
    • Notice grayscale pixel data histogram
    • Support application setting
    • Support application heartbeat
    • Support "Take Photo" command

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for actfw, version 1.3.2
Filename, size File type Python version Upload date Hashes
Filename, size actfw-1.3.2-py3-none-any.whl (27.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page