Coder Social home page Coder Social logo

aditya-diva / ez-cpp-python-socket Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 58.96 MB

Tool to ease cpp python socket communication.

Home Page: https://github.com/Aditya-Diva/Ez-Cpp-Python-Socket

License: MIT License

C++ 46.24% Shell 7.85% Python 45.57% Dockerfile 0.34%
socket-communication python cpp opencv demo socket docker virtual-environments cpp-python-socket webcam

ez-cpp-python-socket's Introduction

Ez-Cpp-Python-Socket


Logo

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.
View Demo · Report Bug · Request Feature

Table of Contents

About The Project

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.

About The Project Gif

Types of messages that can be sent to and fro are as shown below:

Type Cpp Python Extra Info
bool Y Y
string Y Y
int Y Y
float Y Y
list Y Y vector <-> list
list Y Y vector <-> list
image Y Y cv::Mat

The following configurations are supported:

Server Client
Cpp Cpp
Cpp Py
Py Cpp
Py Py

Addition Server-Client Configurations include:

  • Polling in case address is busy: Cpp Python
  • Start and end tokens for every message passed Cpp Python
  • Continuous streaming (with webcam) Cpp Python

Built With

  • Python
  • Cpp
  • Docker
  • OpenCV

Getting Started

Preferably use dockers or virtual environments. For a quickstart demo, do not follow local installation steps.

Installation

  1. Clone the repo

    git clone https://github.com/Aditya-Diva/Ez-Cpp-Python-Socket.git
  2. Enter the directory of the repo

  3. Follow launch specific instruction

    • Linux Local Installation

      ./install_dep.sh # Install all python dependencies

      C++ Dependencies : Install OpenCV

    • Docker (Linux)

      ./build_docker.sh # Build docker image in demo or dev mode

Demo

Run Examples

run_example_gif

Processed Webcam Stream

run_webcam_gif

Docker

./launch_docker.sh # runs demo directly if demo mode was selected while building

# If in dev mode, after launching docker with previous command
./run_examples.sh # run demo
./tests/test_<name_of_test>.sh # to test library configurations as a demo

# Finally to remove the docker image after playing around
./remove_docker.sh # removes docker image from system

Local Installation / VirtualEnv

Assuming that OpenCV has already been installed and accessible by C++. Run shell script to download python dependencies and run demo. To run demo of server and client together,

./run_examples.sh

To test out demo of example configurations

./tests/test_<name_of_test>.sh

Usage

To inspect usage of commands,
Refer to run_server and run_client scripts in python & cpp folders.
For additional examples check out the examples folders in each folder.

Contributing

Any contributions made are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Aditya Divakaran - @LinkedIn - @Github - @GMail

Note:

  • This was tested on Ubuntu 20.04 in a virtual environment and on Docker.
  • Image used in repo is from Pixabay.
  • This is a fun project that was picked up while understanding socket communication for other projects that I'm tinkering with.

ez-cpp-python-socket's People

Contributors

aditya-diva 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.