Course material for the Multi-agents and computer graphics course

Overview

TC2008B

Course material for the Multi-agents and computer graphics course.

Setup instructions

  • Strongly recommend using a custom conda environment.
  • Install python 3.8 in the environment: conda install python=3.8 Using 3.8 for compatibility reasons. Maybe 3.9 or 3.10 are compatible with all the packages, but will have to check.
  • Installing mesa: pip install mesa
  • Installing flask to mount the service: pip install flask
  • By this moment, the environment will have all the packages needed for the project to run.

Instructions to run the local server and the Unity application

  • Run either the python web server: Server/tc2008B_server.py, or the flask server: Server/tc2008B_flask.py. Flask is considerably easier to setup and use, and I strongly recommend its use over python's http.server module. Additionally, IBM cloud example used flask.
  • To run the python web server:
python tc2008B_server.py
  • To run a flask app:
export FLASK_APP=tc_2008B_flash.py
flask run
  • You can change the name of the app you want to run by changing the environment variable FLASK_APP.

  • Alternatively, if you used the following code in your flask server:

if __name__=='__main__':
    app.run(host="localhost", port=8585, debug=True)

you can run it using:

python tc2008B_flask.py
  • To run a flask app on a different host or port:
flask run --host=0.0.0.0 --port=8585
  • Either of these servers is what will run on the cloud.
  • Once the server is running, launch the Unity scene TC2008B that is in the folder: IntegrationTest.
  • The scene has two game objects: AgentController and AgentControllerUpdate. I left both so that different functionality can be tested: AgentController works with the response of the python web server, while AgentControllerUpdate works with the reponse from the flask server.
  • I updated the AgentController.cs code, and introduced AgentControllerUpdate.cs. Each script parses data differently, depending on the response from either the python web server, or from the flask server. The AgentController.cs script parses text data, while AgentControllerUpdate.cs parses JSON data. I strongly recommend that we use JSON data.
  • The scripts are listening to port 8585 (http://localhost:8585). Double check that your server is launching on that port; specially if you are using a flask server.
  • If the Unity application is not running, or has import issues, I included the Unity package that has the scene Sergio Ruiz provided.

Instruction to run the cloud server and Unity application

Installing dependencies, and locally running the sample

# ...first add the Cloud Foundry Foundation public key and package repository to your system
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
# ...then, update your local package index, then finally install the cf CLI
sudo apt update
sudo apt install cf8-cli
  • To get the sample app running:
git clone https://github.com/IBM-Cloud/get-started-python
cd get-started-python
  • To run locally:
pip install -r requirements.txt
python hello.py

To deply the sample to the cloud

  • All the requiered files for the sample app to run are inside the IBMCloud folder.
  • We first need a manifest.yml file. The one provided in the example repository contains the following:
applications:
 - name: GetStartedPython
   random-route: true
   memory: 128M
  • You can use the Cloud Foundry CLI to deploy apps. Choose your API endpoint:
cf api 
   

   

Replace the API-endpoint in the command with an API endpoint from the following list:

URL Region
https://api.ng.bluemix.net US South
https://api.eu-de.bluemix.net Germany
https://api.eu-gb.bluemix.net United Kingdom
https://api.au-syd.bluemix.net Sydney
  • Login to your IBM Cloud account:
cf login
  • From within the get-started-python directory push your app to IBM Cloud:
cf push
  • This process can take a while. All the dependencies are downloaded and installed, and the app in started.
  • After you push the application, in the cloud dashboard you can see a new cloud foundry app.
  • This can take a minute. If there is an error in the deployment process you can use the command cf logs --recent to troubleshoot.
  • When deployment completes you should see a message indicating that your app is running. View your app at the URL listed in the output of the push command. You can also issue the cf apps.
  • With the cf apps command you can see the route for the app.

To deploy a custom app to the cloud

  • I created an app within the cloud foundry in the ibm cloud by following the document Manual IBM Cloud - Python.pdf.
  • Created an additional folder inside the IBMCloud folder, named boids, that contains the required files.
  • In the manifest.yml I renamed the name to the one I used for the app in cloud foundry. From GetStartedPython to Boids.
  • Then, modified the ProcFile file as follows:
web: python tc2008B_flask.py
  • Modified the setup.py file, but I do not think it matters.
  • Then changed to the boids folder, and used:
cf push
  • Then, update the url for the service in Unity with the url for the service that cloud foundry assigns.

Notes

  • Using VSCode to develop everything.
  • Although not stated in the requirements, Git needs to be installed on the system.
  • I am running windows, and using the WSL. I ran the server code in WSL, and the Unity client in windows. My WSL machine runs Ubuntu 20.
  • Using Thunder Client extension as a replacement for postman to test the apis.
  • Pip does not allow us to search anymore.
  • As of 2021-10-17, the WWWForm method to post from Unity to the web service still works with Unity 20.20.3.4. However, the support apparently is going away soon.
  • Using flask because it is ideal for building smaller applications. Django could be used, but since it is much more robust, the additional utilities were not needed for this project.
  • The demo app push process went rather smoothly, but for the boids app it did not. It took too long, and ended up failing with a timeout error. I issued the command again.
  • Timeout again. Modified the manifest, and tried again.
  • After that, the app failed when it tried to start. Apparently, numpy was missing from the requirements.

TO DO

  • [ x ] Add the mesa code instead of the Boids code.
  • [ x ] Check synchronization, clients, maybe in the cloud, most likely in flask
  • Check cloud documentation or ask for a course? Instances, connections, etc.

Dependencies

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched or copy-pasted. ocrmypdf # it's a scriptable c

jbarlow83 7.9k Jan 03, 2023
Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless.

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API.

Roboflow 52 Dec 23, 2022
Official implementation of "An Image is Worth 16x16 Words, What is a Video Worth?" (2021 paper)

An Image is Worth 16x16 Words, What is a Video Worth? paper Official PyTorch Implementation Gilad Sharir, Asaf Noy, Lihi Zelnik-Manor DAMO Academy, Al

213 Nov 12, 2022
Developed an AI-based system to control the mouse cursor using Python and OpenCV with the real-time camera.

Developed an AI-based system to control the mouse cursor using Python and OpenCV with the real-time camera. Fingertip location is mapped to RGB images to control the mouse cursor.

Ravi Sharma 71 Dec 20, 2022
Discord QR Scam Code Generator + Token grab mobile device.

A Python script that automatically generates a Nitro scam QR code and grabs the Discord token when scanned.

Visual 9 Nov 22, 2022
An advanced 2D image manipulation with features such as edge detection and image segmentation built using OpenCV

OpenCV-ToothPaint3-Advanced-Digital-Image-Editor This application named ‘Tooth Paint’ version TP_2020.3 (64-bit) or version 3 was developed within a w

JunHong 1 Nov 05, 2021
A tool to make dumpy among us GIFS

Among Us Dumpy Gif Maker Made by ThatOneCalculator & Pixer415 With help from Telk, karl-police, and auguwu! Please credit this repository when you use

Kainoa Kanter 535 Jan 07, 2023
Unofficial implementation of "TableNet: Deep Learning model for end-to-end Table detection and Tabular data extraction from Scanned Document Images"

TableNet Unofficial implementation of ICDAR 2019 paper : TableNet: Deep Learning model for end-to-end Table detection and Tabular data extraction from

Jainam Shah 243 Dec 30, 2022
Assignment work with webcam

work with webcam : Press key 1 to use emojy on your face Press key 2 to use lip and eye on your face Press key 3 to checkered your face Press key 4 to

Hanane Kheirandish 2 May 31, 2022
ERQA - Edge Restoration Quality Assessment

ERQA - a full-reference quality metric designed to analyze how good image and video restoration methods (SR, deblurring, denoising, etc) are restoring real details.

MSU Video Group 27 Dec 17, 2022
A curated list of promising OCR resources

Call for contributor(paper summary,dataset generation,algorithm implementation and any other useful resources) awesome-ocr A curated list of promising

wanghaisheng 1.6k Jan 04, 2023
A simple QR-Code Reader in Python

A simple QR-Code Reader written in Python, that copies the content of a QR-Code directly into the copy clipboard.

Eric 1 Oct 28, 2021
The world's simplest facial recognition api for Python and the command line

Face Recognition You can also read a translated version of this file in Chinese 简体中文版 or in Korean 한국어 or in Japanese 日本語. Recognize and manipulate fa

Adam Geitgey 47k Jan 07, 2023
轻量级公式 OCR 小工具:一键识别各类公式图片,并转换为 LaTeX 格式

QC-Formula | 青尘公式 OCR 介绍 轻量级开源公式 OCR 小工具:一键识别公式图片,并转换为 LaTeX 格式。 支持从 电脑本地 导入公式图片;(后续版本将支持直接从网页导入图片) 公式图片支持 .png / .jpg / .bmp,大小为 4M 以内均可; 支持印刷体及手写体,前

青尘工作室 26 Jan 07, 2023
Um simples projeto para fazer o reconhecimento do captcha usado pelo jogo bombcrypto

CaptchaSolver - LEIA ISSO 😓 Para iniciar o codigo: pip install -r requirements.txt python captcha_solver.py Se você deseja pegar ver o resultado das

Kawanderson 50 Mar 21, 2022
Table recognition inside douments using neural networks

TableTrainNet A simple project for training and testing table recognition in documents. This project was developed to make a neural network which reco

Giovanni Cavallin 93 Jul 24, 2022
Detect textlines in document images

Textline Detection Detect textlines in document images Introduction This tool performs border, region and textline detection from document image data

QURATOR-SPK 70 Jun 30, 2022
Qrcode Attendence System with Opencv and Pyzbar

Setup process Creates a virtual environment (Scripts that ensure executed Python code uses the Python interpreter and site packages installed inside t

Ganesh 5 Aug 01, 2022
MeshToGeotiff - A fast Python algorithm to convert a 3D mesh into a GeoTIFF

MeshToGeotiff - A fast Python algorithm to convert a 3D mesh into a GeoTIFF Python class for converting (very fast) 3D Meshes/Surfaces to Raster DEMs

8 Sep 10, 2022
Repository collecting all the submodules for the new PyTorch-based OCR System.

OCRopus3 is being replaced by OCRopus4, which is a rewrite using PyTorch 1.7; release should be soonish. Please check github.com/tmbdev/ocropus for up

NVIDIA Research Projects 138 Dec 09, 2022