Giter VIP home page Giter VIP logo

gdv-tutorials's Introduction

GDV

This repository contains exercises for the course "Grafische Datenverarbeitung" at HS Furtwangen University. Please note that all content here is tentative and will be adapted to the student's needs during the semester.

Prerequisites

First, we need to download and install Python 3 from python.org. The recommended version is 3.10.7 or above. Then, we can use the following terminal command to inspect the currently installed version:

Windows MacOS
python --version
python3 --version

Ensure that the terminal and selected interpreter use the correct version.


Usually, the Python installation includes the dependency management tool pip out of the box. If not, download and install it from pip.pypa.io. The minimum required version is 19.3 and above. We can again use a terminal command to check the version:

Windows MacOS
pip --version
python3 -m pip --version

If you need to update your pip version use

python -m pip install --upgrade pip

Do not forget to use python3 instead of python on MacOS.

Getting Started with Python

A great selection of useful resources are:

Setting up the development environment

Generally, one can use any code editor or IDE to follow these exercises, but we recommend that students use VS Code. You can download VS Code from https://code.visualstudio.com/. On Linux, you can follow the instructions on this page. On Arch-based systems, you can use the OSS version code (Link) or the fully featured proprietary version visual-studio-code-bin (Link) from AUR.

VS Code extensions

  • Python ms-python.python: Python support in VS Code (Link)
  • Pylance ms-python.vscode-pylance: Python language server (Link)
  • Python Image Preview 076923.python-image-preview: you can quickly check your Python image data during debugging (Link)
  • Todo Tree Gruntfuggly.todo-tree: provides an overview of all code lines marked with "TODO" (Link)

Python Virtual Environments

To more easily develop Python code, it is recommended to set up a virtual environment (VENV) in the project root folder. The following terminal command will create the hidden folder .venv in your current project folder:

python -m venv .venv

Do not forget to use python3 instead of python on MacOS.

Next, we need to enable the VENV. The VENV will only be active for the current terminal session. Closing the terminal and re-opening it will disable the VENV. So always make sure to enable it before you start developing.

# For Windows use
.venv\Scripts\Activate.ps1

# For Linux and Mac OS
source .venv/bin/activate

Special care is needed when using Windows. Please consult the following guide for more information. When the environment is activated, you should see this as a prefix on your terminal.


On both Operation Systems, one can deactivate the VENV with the following terminal command:

deactivate

Installing dependencies

Installing the required dependencies is straightforward:

pip install .

This will load the defined dependencies in pyproject.toml and install them inside the VENV. Note that the ultralytics module needed for the last tutorials is excluded, as this sums up to more than one Gigabyte of data as some machine learning modules are included (e.g. torch).

If you want to install it later use:

pip install ultralytics

Happy coding!

Now you are ready to start working on the exercises. The tutorials/src folder contains all the code. The idea is to start with the <XX>-<NAME>.problem.py files and try to fulfill the TODOs. These "problem" files will guide you in the right direction. You can ask for help during the lecture if there are any questions. Next, the <XX>-<NAME>.solution.py files contain the solution. After you implement your solution, use this file to compare and add some improvements to your code.

Helpful resources

Python

You can use https://docs.python.org/3/ as a starting point, and the Library Reference or the Language Reference should contain all the needed information.

OpenCV reference

See https://docs.opencv.org/4.x/ for the OpenCV code reference. Here, all OpenCV methods are explained. If you want to know about parameters and flags, this is the page to look them up.

NumPy

OpenCV uses NumPy ndarrays as the default format for data exchange. It can create, operate on, and work with NumPy arrays. For some operations, import the NumPy module and use special functions provided by NumPy. Other libraries like TensorFlow and SciPy also use NumPy. See the official docs for the API reference.

gdv-tutorials's People

Contributors

uhahne avatar spezifisch-de 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.