Simple python 2/3 library for transporting images/data to a remote machine, applying transformations and returning a response.
Project description
SimpleDataTransport
Simple python 3 library for transporting images to a remote machine, applying transformations and returning a response.
Usage
Start a server on the remote machine:
from SimpleDataTransport import DataReceiver
# Callback takes a single dict with an image and returns a dict of useful data
def example_callback(data):
img = data["image"]
return {'message': 'image received. size={}x{}'.format(img.shape[1], img.shape[0])}
# Initialize the Flask application
flask_receiver = DataReceiver()
flask_receiver.set_callback(example_callback)
flask_receiver.run()
On the local machine you can send an image and get an appropriate response:
from SimpleDataTransport import DataSender
import numpy as np
img = np.zeros((1080, 1920))
response = DataSender(img)
print(response) # {'message': 'image received. size=1920x1080'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for SimpleDataTransport-1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0425ea82dde6978a23bcfc60543348c02f1c76164e52bf628815abc5fb4c4f1a |
|
MD5 | 26f3c40c429839691b20d763320a3154 |
|
BLAKE2b-256 | 73fcd3285fadcfa1cba2d9f7b746f2ab080f895c57f51b56ceb5a7cb8d7d4ba0 |