Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
@Home rocking some AI projects

El Bruno elbruno

💭
@Home rocking some AI projects
View GitHub Profile
View YoloV3Analyzer.py
# Bruno Capuano 2020
# performs object detection using YoloV3 in an image and return the processed image
import imghdr
import os
import numpy as np
import cv2
import time
class yoloV3_analyzer:
@elbruno
elbruno / YoloV3SimpleSample.py
Created Sep 15, 2020
YoloV3SimpleSample.py
View YoloV3SimpleSample.py
# Bruno Capuano 2020
# simple implementation for YoloV3 object detection
import cv2
from yoloanalyzer import yoloV3_analyzer
image_path = "02.jpg"
# init Analyzer with confidence 50%
ya = yoloV3_analyzer(0.5)
View MLNetAutoMLRanking.cs
using System;
using System.Linq;
using System.Net.Http.Headers;
using Microsoft.ML;
using Microsoft.ML.AutoML;
using Microsoft.ML.Data;
namespace ConsoleApp1
{
public class Program
@elbruno
elbruno / PySimpleGui2ContextMenu.py
Created Aug 18, 2020
PySimpleGui2ContextMenu.py
View PySimpleGui2ContextMenu.py
# Bruno Capuano 2020
# display the camera feed using OpenCV
# display FPS
import time
import cv2
import PySimpleGUI as sg
# init Windows Manager
sg.theme("DarkBlue")
@elbruno
elbruno / PySimpleGui2camview.py
Created Aug 17, 2020
PySimpleGui2camview.py
View PySimpleGui2camview.py
# Bruno Capuano 2020
# display the camera feed using OpenCV
# display the camera feed with grayscale using OpenCV
import time
import cv2
import PySimpleGUI as sg
# Camera Settings
camera_Width = 320 # 480 # 640 # 1024 # 1280
@elbruno
elbruno / Unity3DDetectImage.cs
Last active Aug 7, 2020
Unity3DDetectImage.cs
View Unity3DDetectImage.cs
string DetectImage(byte[] image, string imageUrl)
{
string body = string.Empty;
using (var request = UnityWebRequest.Post(imageUrl, ""))
{
request.SetRequestHeader("Content-Type", "application/octet-stream");
request.uploadHandler = new UploadHandlerRaw(image);
request.SendWebRequest();
@elbruno
elbruno / WebServerMultiThreadRequestsFastAPI.py
Created Jul 6, 2020
WebServerMultiThreadRequestsFastAPI.py
View WebServerMultiThreadRequestsFastAPI.py
# Bruno Capuano
# simple webserver with fastapi
# run with uvicorn 07:app -reload
# test with http://127.0.0.1:8000/getdata
# on each call, validate if the thread is started,
# of the thread is None, start a different thread +1 a shared var
from typing import Optional
from fastapi import FastAPI
@elbruno
elbruno / WebServerMultiThreadRequests.py
Created Jul 5, 2020
WebServerMultiThreadRequests.py
View WebServerMultiThreadRequests.py
# Bruno Capuano
# start a webserver with flask in a thread
# start a different thread +1 a shared var
from flask import Flask
import threading
import time
iCounter = 0
data = 'foo'
@elbruno
elbruno / WebCamObjectDetectionYoloV3.py
Created Jun 8, 2020
WebCamObjectDetectionYoloV3.py
View WebCamObjectDetectionYoloV3.py
# Bruno Capuano 2020
# display the camera feed using OpenCV
# display FPS
# load YOLO object detector trained with COCO Dataset (80 classes)
# analyze each camera frame using YoloV3 searching for banana classes
import numpy as np
import time
import cv2
import os
@elbruno
elbruno / WebCamObjectDetectionMobileNetSSD.py
Created Jun 8, 2020
WebCamObjectDetectionMobileNetSSD.py
View WebCamObjectDetectionMobileNetSSD.py
# Bruno Capuano 2020
# display the camera feed using OpenCV
# display FPS
# load MobileNetSSD object detector trained with COCO Dataset (20 classes)
# analyze each camera frame using MobileNet
# enable disable obj detection pressing D key
import numpy as np
import time
import cv2
You can’t perform that action at this time.