Skip to content

Instantly share code, notes, and snippets.

View nabeelmsft's full-sized avatar

Muhammad Nabeel nabeelmsft

View GitHub Profile
#pragma once
// Standard library includes
#include <string>
#include <vector>
// Third party includes
#include <opencv2/core.hpp>
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Standard library includes
#include <fstream>
#include <string>
#include <vector>
#include <stdio.h>
#include <curl/curl.h>
#include <iostream>
void ObjectDetector::preview(cv::Mat &rgb, const std::vector<cv::Rect> &boxes, const std::vector<int> &labels, const std::vector<float> &confidences) const
{
// This method is responsible for marking up the raw BGR frames with the inferences from the
// neural network. Since all of our object detector networks output bounding boxes, labels, and confidences,
// let's mark up the frames with those items.
std::string artext = std::string("");
for (std::size_t i = 0; i < boxes.size(); i++)
{
// Draw a bounding box around the detected object. Use a new color each time
// up to some point, at which point we wrap around and start reusing colors.
@nabeelmsft
nabeelmsft / TwinsUpdateBetaFunction.cs
Created July 8, 2021 04:49
IoT and new Azure Function Extension Libraries
using Azure.Messaging.EventHubs;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TwinsUpdateBetaFunctionApp.Model;
namespace TwinsUpdateBetaFunctionApp
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import uuid
import re
import json
import time
import types
import os
#!/usr/bin/python
import jetson.inference
import jetson.utils
import argparse
import sys
import os
import asyncio
@nabeelmsft
nabeelmsft / detect-post-object.py
Last active April 12, 2021 09:22
Device side code for AI on edge with the new Azure SDK support
#!/usr/bin/python
import jetson.inference
import jetson.utils
import argparse
import sys
import os
import asyncio
@nabeelmsft
nabeelmsft / detect-object.py
Created January 7, 2021 09:10
Object detection code running on Nvidia Jetson Nano device
#!/usr/bin/python
import jetson.inference
import jetson.utils
import argparse
import sys
import os
import asyncio