Blog

  • Principle-Concepts-of-Computer-Vision

    Principles of Computer Vision for AI

    Author

    Matthias Bartolo 0436103L

    Preview:

    Description of Task:

    Through the following tasks, a deeper understanding of computer vision was achieved, with a particular focus on tools and frameworks that enabled its implementation:

    In the first part of the task, a variety of Data Augmentation techniques in computer vision were explored, encompassing both theoretical and practical aspects. The objectives involved investigating the concept of data augmentation, conducting a comprehensive review of relevant literature, implementing selected techniques using TensorFlow, PyTorch, and OpenCV, and evaluating the performance of augmented images in comparison to other approaches and the original images. Valuable insights into the potential and effectiveness of data augmentation techniques in computer vision were obtained.

    In the second part of the task, various tutorials were followed to delve into specific tasks that enhance computer vision capabilities. This endeavor involved experimenting with a wide range of techniques, including both Point Processing and Area Processing. Convolution techniques, including sobel kernel, box filter, and gaussian kernel, were studied, as they play a fundamental role in tasks such as edge detection and smoothing. Additionally, Morphology operations like dilation, erosion, opening, closing, and text segmentation were explored, which are crucial for image processing tasks like noise removal, shape detection, and text extraction. Feature Detection techniques, such as Corner Harris, Sci Thomasi, SIFT, SURF, and ORB, were also examined, as they enable the identification and extraction of distinctive features for tasks like object recognition and tracking.

    data augmentation image

    By completing these tasks, the project achieved a comprehensive understanding of computer vision principles and techniques. The exploration of data augmentation techniques, along with the utilization of tools and frameworks, provided valuable insights into the potential and effectiveness of computer vision applications.

    Deliverables:

    The repository includes the Computer Vision Tutorials and Group Project.

    Visit original content creator repository
  • simple-ca

    Simple CA

    This tool is a simple CA intended to be executed via cli and http.

    Mainly intended for development/testing environments.

    Build executable

    go build

    Update config.yml

    data_directory: ./tmp/
    http_server:
        listen_address: 127.0.0.1
        listen_port: 5000
    all_ca_configs:
        ca_1:
            subject:
                common_name: My CA 1
                country:
                    - IT
                organization:
                    - ACME Corp
                organizational_unit:
                    - PKI
                locality: []
                province: []
                street_address: []
                postal_code: []
            validity:
                years: 1
                months: 1
                days: 10
            key_config:
                type: rsa
                config:
                    size: 4096
            crl_ttl: 12h
            permitted_dns_domains_critical: true
            permitted_dns_domains: []
            excluded_dns_domains: []
            permitted_ip_ranges:
                - 192.168.0.0/16
                - 10.0.0.0/8
            excluded_ip_ranges: []
            permitted_email_addresses: []
            excluded_email_addresses: []
            permitted_uri_domains: []
            excluded_uri_domains: []
            http_server_options:
                users:
                    my_user: my_pass
    

    Bootstrap CAs

    ./simple-ca

    Local use

    Generate csr using openssl

    openssl req \
        -nodes \
        -subj "/CN=www.example.com" \
         -addext "subjectAltName = DNS:www.example.com , DNS:www2.example.com" \
        -addext "extendedKeyUsage = serverAuth, clientAuth" \
        -addext "keyUsage=keyEncipherment" \
        -newkey rsa:2048 \
        -keyout ${KEYS_DIR}/www.example.com.key.pem \
        -out ${CSRPOOL}/www.example.com.csr.pem
    
    
    openssl req \
        -in ${CSRPOOL}/www.example.com.csr.pem \
        -noout \
        -text

    Sign all CSRs and generate new CRL

    ./simple-ca

    HTTP server

    Run

    ./simple-ca http

    Requests

    openssl req \
        -nodes \
        -subj "/CN=www.example.com" \
         -addext "subjectAltName = DNS:www.example.com , DNS:www2.example.com" \
        -addext "extendedKeyUsage = serverAuth, clientAuth" \
        -addext "keyUsage=keyEncipherment" \
        -newkey rsa:2048 \
        -keyout ${KEYS_DIR}/www.example.com.key.pem \
        -out ${CSR_DIR}/www.example.com.csr.pem
    
    
    openssl req \
        -in ${CSR_DIR}/www.example.com.csr.pem \
        -noout \
        -text
    
    CA_ID=ca_1
    
    curl \
        -sSLf \
        -T ${CSR_DIR}/www.example.com.csr.pem \
        --user my_user:my_pass \
        -X POST \
        http://localhost:5000/ca/$CA_ID/csr/sign
    
    curl \
        -sSLf \
        --user my_user:my_pass \
        -X POST \
        http://localhost:5000/ca/$CA_ID/crt/revoke/12345

    Visit original content creator repository

  • google-tag-manager-controller

    Google Tag Manager Python API

    🐍 Table of Contents 🐍

    ⚡ About ⚡

    The Google Tag Manager API provides access to Google Tag Manager configuration data for an authorized user. With this API you can manage: accounts, containers, worksapces, tags, triggers and variables

    Benefit

    The Google Tag Manager API handles millions of operations. To protect the system from receiving more operations than it can handle, and to ensure an equitable distribution of system resources, it is necessary to employ a quota system.

    Info

    https://developers.google.com/tag-manager/api/v2/reference
    https://developers.google.com/tag-manager/api/v2/devguide

    Software architecture

    GitHub Logo

    Quota Limits

    • 50,000 requests per project per day, which can be increased.
    • 10 queries per second (QPS) per IP address
    • By default, it is set to 100 requests per 100 seconds per user
    • This can be adjusted to a maximum value of 1,000.

    Setup

    0. activate venv

    python -m venv venv
    source ./venv/bin/activate (Mac) or venv\Scripts\activate (Windows)

    1. install the packages

    pip install -r requirements.txt

    2. create the service account & OAuth client in GCP for the Google Tag Manager API

    https://console.cloud.google.com/

    3. download the client secrets.json (OAuth 2.0 Client ID)

    4. create conf repository and locate client_secrets.json into this repository

    mkdir conf
    mv xxxxx-xxxxx.json client_secrets.json

    5. create .env and put there private key and sensitive information

    touch .env

    6. setup the .env

    • CLIENT_SECRETS=’conf/client_secrets.json’
    • ACCOUNT_ID=’xxxx’
    • CONTAINER_NAME=’xxxx’
    • CONTAINER_ID=’xxxx’
    • WORKSPACE_NAME=’xxxx’
    • WORKSPACE_ID=’xx’

    7. setup GTM account info

    CLIENT_SECRETS = config('CLIENT_SECRETS')
    ACCOUNT_ID = config('ACCOUNT_ID')
    CONTAINER_NAME= config('CONTAINER_NAME')
    CONTAINER_ID = config('CONTAINER_ID')
    WORKSPACE_NAME = config('WORKSPACE_NAME')
    WORKSPACE_ID = config('WORKSPACE_ID')

    8. RUN GTM Scanner to see the GTM information

    you can scan the account, container, workspace, tag, trigger, variable information by using gtm_scanner.py

    python project/run_scanner.py

    8. RUN GTM Creator

    you can create new workspaces, tags, triggers, variables and publish these by using gtm_creator.py

    python project/run_creator.py

    Visit original content creator repository