Giter VIP home page Giter VIP logo

image-processing-server's Introduction

Image-Processing-Server

Created this for socket based image processing. Easily create multi process image processing servers and pass a processing function in

  1. Client
from ImageProcessingServer import ImageClient
import cv2

# Get an iamge
school_img = cv2.imread('school.jpg')

# Open connection to server
image_client = ImageClient('localhost',8000)
image_client.start()

# Stream content and get response
response = image_client.transmit(school_img)
print response

# Close connection to server
image_client.stop()
  1. Server
from ImageProcessingServer import ImageServer
import cv2

def process_image1(flags, img):
  print flags
  return "DONE1"

def process_image2(flag, img):
  print flags
  return "DONE2"

# Create instance of image server and attach processes to them
image_server = ImageServer()

# Launch a server instances
image_server.launch_process(port=8000, func=process_image1)
image_server.launch_process(port=8001, func=process_image2)

# Send flags to server instances
image_server.set_flag(port=8000, flag='test', value=0)
image_server.set_flag(port=8000, flag='test', value=1)

# Simulate ending of server
time.sleep(10)
# image_server.end_process(8000)
# image_server.end_process(8001)
image_server.end_all()

image-processing-server's People

Contributors

soulslicer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.