fabiochiu/medium-articles huggingface dataset:
CVPR20 (Selected Detection Papers)
By: Sohel Rana
Tags: Cvpr 2020, Cvpr, Computer Vision, Object Detection, Neural Networks

I choose few object detection papers from CVPR20 conference. Hopefully, I will explain significant papers from the list below:

Detection in Crowded Scenes: One Proposal Multiple Predictions. Details review. [Link][Review]

NMS by Representative Region: Towards Crowded Pedestrian Detection by Proposal Pairing. [Link]

Where, What, Whether: Multi-modal Learning Meets Pedestrian Detection. [Link]

DR Loss: Improving Object Detection by Distributional Ranking. [Link]

Multiple Anchor Learning for Visual Object Detection. [Link]

Learning from Noisy Anchors for One-stage Object Detection. [Link]

Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector. [Link]

SaccadeNet: A Fast and Accurate Object Detector. [Link]

Multimodal and multiview distillation for real-time player detection on a football field. [Link]

SLV: Spatial Likelihood Voting for Weakly Supervised Object Detection. [Link]
Turning the Mobile Camera into a Real-Time Object Detector with Flutter and TensorFlow Lite
By: Ravindu Senaratne
Tags: Machine Learning, Flutter, Mobile App Development, Object Detection, Heartbeat

In the previous article of this series on developing Flutter applications with TensorFlow Lite, we looked at how we can develop Digit Recognizer with Flutter and TensorFlow Lite, Image Classification with Flutter and TensorFlow Lite, and Object Detection with Flutter and TensorFlow Lite.

In the fourth article of this series, we’ll keep working with TensorFlow Lite, this time focusing on implementing Real-Time Object Detection by integrating the mobile camera. The application we are going to build will be able to recognize the objects from the live feed provided by the camera. After a month of researching and reading blogs, I was able to come with a solution to integrate the mobile camera as a real-time image provider and do the object detection through it. In this article, I will show you how to do the same.

Application and Use cases

TensorFlow Lite gives us pre-trained and optimized models to identify hundreds of classes of objects, including people, activities, animals, plants, and places. Using the COCO SSD MobileNet v1 model and Camera Plugin from Flutter, we will be able to develop a real-time object detector application.

Required Packages

TensorFlow Lite

Camera Plugin

Using this plugin we can display live camera preview as a widget. Using CameraImage class we can capture the live feed frame-by-frame where we can provide these frames as images to do object detection.

COCO SSD MobileNet v1 Model

The SSD MobileNet model is a single shot multibox detection (SSD) network intended to perform object detection. This model can detect up to 10 objects in a frame. It is trained to recognize 80 classes of objects.
Python影像辨識筆記(二十三)：NanoDet，可能是目前最輕量化的Object Detection模型
By: Yanwei Liu
Tags: Python, Machine Learning, Artificial Intelligence, Object Detection, Deep Learning

更新

原作者知乎文章

GitHub連結

官方釋出的對照表

如上圖所示，與YOLO v3/v4系列的Tiny版本相比，NanoDet在416*416的size下，明顯勝過YOLO模型。在Model size只有約略十分之一左右的情況下，AP@0.5:0.95(即圖中的mAP)甚至與YOLOv4-Tiny一模一樣，真的非常強大。

使用方式

本文假設讀者已完成PyTorch的安裝，且不考慮virtual environment使用的情況。因此我們將直接從套件安裝開始

pip install Cython termcolor numpy tensorboard pycocotools matplotlib pyaml opencv-python tqdm git clone https://github.com/RangiLyu/nanodet.git

cd nanodet

python setup.py develop

資料集

可以使用get_coco2017.sh來進行資料圖片下載

#!/bin/bash

# Zip coco folder

# zip -r coco.zip coco

# tar -czvf coco.tar.gz coco

filename="coco2017labels.zip"

fileid="1cXZR_ckHki6nddOmcysCuuJFM--T-Q6L"

curl -c ./cookie -s -L "

curl -Lb ./cookie "

rm ./cookie # Download labels from Google Drive, accepting presented queryfilename="coco2017labels.zip"fileid="1cXZR_ckHki6nddOmcysCuuJFM--T-Q6L"curl -c ./cookie -s -L " https://drive.google.com/uc?export=download&id=${fileid }" >/dev/nullcurl -Lb ./cookie " https://drive.google.com/uc?export=download&confirm=$(awk '/download/ {print $NF}' ./cookie)&id=${fileid}" -o ${filename}rm ./cookie # Unzip labels

unzip -q ${filename} # for coco.zip

# tar -xzf ${filename} # for coco.tar.gz

rm ${filename}

cd coco/images

f="train2017.zip" && curl

f="val2017.zip" && curl # Download and unzip imagescd coco/imagesf="train2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $ff="val2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $f # cd out

cd ../..

Config檔案準備

開啟config/裡面的nanodet-m.yml檔案進行修改

修改save_path路徑到您所指令的位置

修改num_classes到目標class的數量

修改image path and annotation path的路徑到上一個步驟所取得的COCO圖片路徑位置

修改第69行的device，指定第幾顆GPU以及batch size等相關參數

可自己修改total_epochs、lr和lr_schedule來符合自己的需求 更多詳情，請參考 config_file_detail.md

訓練

#單顆GPU

python tools/train.py config/nanodet-m.yml #多顆GPU(目前Windows在1.7版以前的PyTorch，尚不支援多GPU訓練)

python -m torch.distributed.launch --nproc_per_node=GPU_NUM --master_port 29501 tools/train.py CONFIG_PATH

NanoDet的完整架構圖

下載並解壓nanodet_ncnn_model.zip後，可使用Netron開啟nanodet_m.param檔案，呈現如下圖的完整架構
Tensorflow 2 Object Detection with Colab
By: Art Krisada
Tags: Tensorflow2, Object Detection, Google Colab, Captcha

My short notes on using google colab to train Tensorflow Object Detection.

In this note, I use TF2 Object detection to read captcha. You will need 200–300 captcha to train. You need to train 40,000–50,000 steps. This will take 12 -13 hours of training in colab(CPU). It will take only 1–2 hours if you use GPU instead. Check point and Logs will take 3–5GB in your Google drive.

You can change run time type to GPU acceleration.

These are references articles.

You can create Image label by follow this article.

Go to https://colab.research.google.com/notebooks/intro.ipynb and create new notebook name tf2_captcha_test.ipynb.

Set up path in your google drive. You can see example in my github project below. My captcha pictures are only for example (15 pictures). You should add your dataset or use public dataset to train.

Example Folder

Start with mounting your Google drive. Google will authen and verify your account.

Install Tensorflow model from https://github.com/tensorflow/models

Install Object Detection API.

Check installation by running model_builder_tf2.py

Create pbtxt file. It mapped id with label. You can use my file in my repo as an example. It contain 36 items (a-z and 0–9)

Create tfrecord for train and val. You will get two new files, pascal_train.record and pascal_val.record

You can use my_create_pascal_tf_record from my repo. I make some change from objectdetection API example (create_pascal_tf_record.py)

Create config file. I use template for ssd_mobilenet_v2_320x320_coco17_tpu-8. You can copy from example objectdetection/config/tf2/ssd_mobilenet_v2_320x320_coco17_tpu-8.config to create new file “ssd_mobilenet_v2_320x320_coco17_tpu-8-collab.config”

Change path and parameter in .config file.

change num_classes to match the number of class in pbtxt file.

Change batch_size, and step to match your train.

Change path to match your Google Drive Path.

You can monitor by running Tensorboard. Log dir. is in folder ../train/train

Start training and save checkpoint to our train folder.

Next, Export your model to use later.

Load your model.

Run Test

You will see the result like these samples. These are results after training around 50,000 steps with 250 datasets
Image Background Remover Using Detectron2
By: Surbhi Kathiriya
Tags: Mask R Cnn, Machine Learning, Pytorch, Detectron2, Object Detection

Detectron2 is a ground-up rewrite of Detectron that started with maskrcnn-benchmark. The platform is now implemented in PyTorch. With a new, more modular design, Detectron2 is flexible and extensible, and able to provide fast training on single or multiple GPU servers. Detectron2 includes high-quality implementations of state-of-the-art object detection algorithms, including DensePose, panoptic feature Pyramid networks, and numerous variants of the pioneering Mask-R-CNN model family also developed by FAIR. Its extensible design makes it easy to implement cutting-edge research projects without having to fork the entire codebase. for more information you can visit here.

In this blog, I have shown installation and working of detectron2.

System Requirements

Linux or macOS with Python ≥ 3.6

PyTorch ≥ 1.5 and torchvision that matches the PyTorch installation. You can install them together at pytorch.org to make sure of this

that matches the PyTorch installation. You can install them together at to make sure of this OpenCV is optional and needed by demo and visualization

we can also use the Google colab to use detectron2. In this blog I have shown the implementation in google colab.

Installation of Detectron2

In Colab Notebook, just run below code to install detectron2 and other pre-requisites.

Dataset

I have used the COCO dataset for the training of the model. COCO dataset is the dataset used for object detection purpose and it has 80 classes ,80000 training images and 40000 validation images. Below is the code for the downloading the dataset.

Import libraries

Registering dataset

In this step I have registered the dataset using inbuilt detectron2 function that is register_coco_instances.

below i have shown the code which you need to run in colab notebook.

Train the model

In this phase, I trained dataset using detectron2 default trainer and make the the model for predicting the object and making the mask over the object. I have trained the model for 300 iterations.

Below is the code for plotting the trained models some figures.

I have shown the graph for accuracy of model which shows the plot on accuracy / iteration using mask-RCNN.

accuracy of model/iteration

Validating the model

First I read the image using OpenCV and then predicted the object from image using default predictor. Then I have created the mask from the predicted output on image and Then remove the background of object by checking the value of every pixel and if the value of object at pixel is 0 that means pixel is not of an object.

it will read the image and plot it as shown below.

input image

just run the below code in colab notebook. It will produce the image from which background has been removed.

here is the removed background image.
Machine Learning Player v1.1 is out!
By: Viktor Shwartskop
Tags: Ml Player, Machine Learning, Object Detection

Hello! Today we are pleased to announce the second release of our Machine Learning Player. As you may already know, ML Player can be used for visualizing the output of machine learning models.

Here are the features that we have added:

ML Player can now be run on Windows, macOS, and Ubuntu (previously, ML Player was exclusive to Ubuntu).

ML Player now supports Object Detection models that return bounding boxes.

You can specify the processing rate: for example, if the processing rate is 1, then every frame is sent to a model. If the processing rate equals 100, then only every 100th frame is sent to a model. If you run ML Player on CPU, it can be useful for increasing FPS.

Fig 1. ML Player on Windows

We have also fixed a couple of bugs, one of them occurred when a user was in the Camera mode.

The slider was fixed as well: navigation was made more precise.

Fig 2. ML Player on macOS

Let’s look closer at bounding boxes. A bounding box is a rectangle that indicates an object in a frame. Bounding boxes are often used for object detection in Machine Learning.

Fig 3. Object Detection in ML Player

There are ML Player demos for all the technologies that we develop. You can download and try them yourself! Here’s the link.

Fig 4. Object Detection in ML Player (2)

If you read our previous article, you should know about plugins. To create a plugin for a model that returns bounding boxes, you need to add a couple of structures to the header file.

struct FrameImage

{

uint8_t *data;

uint64_t frameNumber;

int width;

int height;

int bytesPerLine;

int format;

};



/// required only for plugins that have "return_type": "bounding_boxes"

struct BoundingBox

{

char *className;

float score;

int x1; /// top-left x

int y1; /// top-left y

int x2; /// bottom-right x

int y2; /// bottom-right y

};



/// required only for plugins that have "return_type": "bounding_boxes"

struct BoundingBoxArray

{

int size; /// the size of the array

BoundingBox *boxes;

};



extern "C"

{

PLUGIN_EXPORT void *processFrame(FrameImage *frame); /// frame processing

PLUGIN_EXPORT void release(); /// deallocate resources here

}

Then, just implement the processFrame function that returns a pointer to BoundingBoxArray containing all the bounding boxes for the current frame. You can find more information and examples in the documentation on ML Player.

We hope you found this article interesting! You can download ML Player here. Contact us if you have any questions. See you soon!
Object Detection in Android with Fritz AI
By: Derrick Mwiti
Tags: Object Detection, Heartbeat, Fritz Ai, Android

In this piece, we shall focus on detecting objects in an image using Fritz AI .Fritz AI pre-trained models allow you to add object detection to your Android and iOS applications with just a few lines of code. The model will provide bounding boxes for each object detected. The models are trained on COCO, a large-scale object detection dataset. The model runs on the device, is fast, and doesn’t require any internet connection for inferencing. The model can also run on live video with a fast frame rate.

Getting Started

The first step is to create an Android project. Once you do, note the application ID. Next, log into your Fritz account and register the application. This will set up communication between your application and Fritz AI.

Click on the next button and name your application. While you are there, don’t forget to enter your application ID. You can find the ID in your app’s build.gradle file.

With that out of the way, you can now install the Fritz AI SDK. In your root-level Gradle file (build.gradle) include the Maven repository for Fritz.

Now add the dependencies for the SDK in app/build.gradle . We add the Fritz Core, Objection Detection, and Vision dependencies. Including the Objection Detection model in your application will make your application larger in size. Now that you have changed the Gradle files, ensure that you sync that with your project. That will download all the necessary dependencies.

Before you close that file add renderscript support to improve image processing performance. Also, specify aaptOptions to prevent compression of TFLite models.

Now register the FritzCustomModelService in the AndroidManifest.

The next step is to initialize the SDK by calling Fritz.configure() with your API Key.

With that in place, click next to verify that your application is able to communicate with Fritz.

Use Fritz Pre-trained Models

The model we shall use will draw a bounding box around the detected object and give us the confidence level.

The App Elements

The application is made up of a button that will choose an image and the image view.
Clasificación y detección de Covid-19 en radiografías de tórax usando Deep Learning e IBM Visual Recognition
By: Jhonatan Camasca
Tags: Computer Vision, Covid 19, X Ray Machine, Object Detection, Deep Learning

Aspiring Data Scientist with a focus on Computer Vision and NLP. LinkedIn: https://www.linkedin.com/in/jhonatancamasca/
Multi-team object detection for football games on Raspberry Pi 3
By: Odemakinde Elisha
Tags: Machine Learning, Computer Vision, Object Detection, Heartbeat, Raspberry Pi 3

Introduction

Computer vision is a branch of deep learning that focuses on the utilization of deep neural networks to model problems from images. In this article, we’ll be looking at how we can apply computer vision as a tool for football analytics.

Football is a sport that involves 2 teams; with each team having 11 players and a goalkeeper. Here are some analytics that could be explored from football games using AI.

Predicting the feasibility of losing a goal via a penalty or free kick. Monitoring player interactions within the game. Predicting who gets the ball next on a given team. Predicting the feasibility of scoring a goal via corner kicks and others.

The notebook for this work can be found here.

At times, football fans of a various teams argue to the extent of predicting how their team could win a game or not. Some go the extra mile of forecasting the game score. The question is, what if we give computers the ability of monitoring various patterns of this game, and then develop a model that gives us an analytic breakdown of a football game that’s currently happening or that is yet to happen?

There are so many analytic insights we could uncover with the aid of computer vision, language modeling, and reinforcement learning architectures, but for the sake of simplicity, let’s look into building an object detection model that can track 4 prominent football teams: Chelsea, Man-City, Liverpool, and Arsenal.

Below is an outline on how we’ll solve this:

Data Sourcing Labelme for data annotation Data preparation (exporting as TensorFlow records). Model setup and training Running inference on Raspberry Pi 3 Results and conclusion

Data Sourcing

To proceed into building an object detection model that can track the 4 teams, we first a need to source of data for the 4 various teams. The source data was taken from matches between Chelsea-Man City and Liverpool — Arsenal. Using the source video, 94 frames representing the 4 various teams were extracted from each video link, using the code below:

The next step is to apply an image annotation tool used in computer vision to label various team members by their team name. An efficient annotation tool for computer vision that we’ll work with here is LabelMe.

LabelMe

LabelMe is an open-sourced graphical labeling tool for image processing and annotations. Source code on how to use it locally can be found here. It’s easy to use and efficient because of its annotation properties. To label the images, click on createRect by the left window. This will give you the flexibility of creating your own polygon annotations for every object present in the images. We can label the images in this order:
Custom Object Detection Using TensorFlow Teachable Machine In Flutter Apps
By: Shivam Ahuja
Tags: AI, TensorFlow, Object Detection, Android, Deep Learning

Trending AI Articles:

Let's begin.

Step 1: Collecting Images

It’s very difficult to manually download each and every image from the internet. NO worries today I’m here to make your life easier

Artificial Intelligence Jobs

.

Here is a Chrome extension to download images in bulk in one go Imageye. Just add it to your browser, search for the object you are looking for. Click on the extension and BOOM!! there you go all the images will be downloaded.

Step 2: Uploading the dataset for training

Open this link. just like show in the picture you have to create a class give the class a label, click on upload>choose images from your files>select the images that you have previously downloaded, repeat this step for all the objects that you want to detect.

Now you are ready to train your model by just clicking on the Train Model button.

Step 3: Exporting the trained model

After the model is trained you can test it by uploading an image and the result will be displayed below.

If everything is working well, now you can export the model. Click on the Export Model button and this popup will open, now select the TensoflowLite tab and click on Download my model. It will download a zip file for you.

Step 4: Creating the flutter project

Clone this repository and install the dependencies by running the command in the terminal

Flutter pub get

Step 5: Replacing the custom trained model with your model

In the assets/tflite folder, you will find two files i.e. ssd_mobilenet.tflite and ssd_mobilenet.txt. Extract the zip file that you downloaded above and replace these files in the assets folder and make sure to rename them.

Step 6: Run the app and test it

Now simply you just have to run the app and the interface looks like this, obviously, this is a demo UI you can make your own tweaks and changes to make it shine.

There You Goo, CONGRATULATIONS 🎊🎉 on your own custom object detector
Objectness Score allows for the computation of Mean Average Precision
By: Harvey Mao
Tags: Machine Learning, Artificial Intelligence, Computer Vision, Object Detection, Deep Learning

In Faster R-CNN, we use one convolution filter to make a 5-parameter prediction: 4 parameters on the predicted box relative to an anchor and 1 objectness confidence sco…
ISWYDS exploring object detection using Darknet and YOLOv4 @Design Museum Gent
By: Olivier Van D'Huynslager
Tags: AI, Museums, Design, Technology, Object Detection

After repeating these steps for all our images we landed on 3000+ images featuring 37 classes (some images containing over 15 classes).

Picking your guns.

When it comes to object detection there are many options to pick from, but for our case, we will be using Darknet an open-source neural network framework written in C and CUDA to train our algorithm of choice; YOLOv4. You Only Look Once or YOLO is a state-of-the-art, real-time object detection system making R-CNN look stale, it is extremely fast, more than 1000x faster than R-CNN, and 100x faster than Fast R-CNN. Another good thing about YOLO is that it’s public domain and based on the license we can do whatever we want to do with it...🧐

YOLO LICENSE

Version 2, July 29 2016



THIS SOFTWARE LICENSE IS PROVIDED "ALL CAPS" SO THAT YOU KNOW IT IS SUPER SERIOUS AND YOU DON'T MESS AROUND WITH COPYRIGHT LAW BECAUSE YOU WILL GET IN TROUBLE HERE ARE SOME OTHER BUZZWORDS COMMONLY IN THESE THINGS WARRANTIES LIABILITY CONTRACT TORT LIABLE CLAIMS RESTRICTION MERCHANTABILITY. NOW HERE'S THE REAL LICENSE:



0. Darknet is public domain.

1. Do whatever you want with it.

2. Stop emailing me about it!

That being said; after configuring our system and installing all the needed dependencies we can take her for a test ride — using some of the pre-trained algorithms that come out of the box, and see what she has to offer.

As we can tell from the results [pictures below], YOLOv4 comes with some pre-trained classes such as a chair, vase, and of course the very -uncanny- human. Let’s not make use of that last one, shall we? Although it missed out on some of the more obscure looking vases, we will be using these pre-trained weights as building blocks to create our very own. The goal here is to output new classes based on the object-number of the objects depicted.
Kubernetes Tutorial: Part 5- A Little Bit of Polishing
By: Parthasarathy Subburaj
Tags: Docker, Streamlit, Kubernetes, Object Detection, Deployment

Ingress

In the last article, we have successfully managed to deploy our application using Minikube and accessed the same via a NodePort Service object with the URL convention <minikube-ip>:<port-number> . But when we are developing a production-grade application, we might have multiple services each running in a different port. And soon it may become quite hazy because we just can't keep track of all the services and their endpoints. Wouldn’t it be better if we have a centralized system that manages external accesses to these services in the cluster which could take care of load balancing, SSL termination of HTTPS traffic and allow us to access the services at fancy name-based virtual hosting? Thanks to Ingress, all these pain points can now be easily managed with its help!

Though Ingress is a very vast topic and quite involved, here we will be just using it to create a Name-Based Virtual Hosting so that we could access our service in a pretty URL instead of the one that we currently have in place.

For us to use Ingress, the cluster must have an Ingress controller running, and it is not set by default. Luckily, Minikube is shipped with an Nginx controller which can be enabled by executing:

minikube addons enable ingress

We can use the following YAML file to create an Ingress:

YAML for Ingress creation

And the same can be created by executing:

kubectl create -f ingress.yaml

The created Ingress object maps the service object-detection-service to the host streamlit.exercise.com (you can think of something more fancier 😛). Since we cannot modify the external DSN server, we have to map Minikube’s IP with the virtual host that we have created, and the same can be achieved by modifying the /etc/hosts . The modified file looks like the one shown below:

partha@jarvis:~$ cat /etc/hosts

127.0.0.1 localhost

<minikube-ip> streamlit.exercise.com

where <minikube-ip> is the IP address of the Minikube which can be obtained by executing minikube ip . And now our service is accessible at:
Artificial Intelligence: Understanding How Object Detection Creates Business Value for Manufacturers
By: Frederick Reinink
Tags: Artificial Intelligence, Manufacturing, Industry 4 0, Object Detection, Quality Assurance

Quality Assurance — Surface Defect Inspection

Musashi, a global supplier of suspension and power train components, estimates that it spends 20% of its time and costs on ensuring that the quality of its finished goods meet the requirements and expectations of its end customers. For organizations facing these same challenges, an ability to substantially decrease those time and financial costs will undoubtedly have a positive impact on the company’s bottom line and has the potential to create a source of competitive advantage as the employees required to complete the very laborious and repetitive task of final goods inspection can be re-positioned within the organization to perform greater value added activities.

Although there has been industry adoption of automated optical inspection processes for some simple inspection tasks, manufacturers of complex parts with challenging inspection requirements still tend to rely on manual inspectors as their final quality control measure. Given that there are known performance limitations with human inspectors, and inspection skills can take significant time to develop, there are clear opportunity factors where despite best efforts, defective goods may still reach an end customer. A quality failure like that can lead to costly customer issues, product recalls, warranty claims and damaged brand reputation.

In fact, the American Society for Quality (ASQ) estimates the cost of quality failures in many organizations is as high as 15% to 20% of sales revenue. Within competitive supply chains, companies battle fiercely for supplier contracts to large OEMs, and a good majority of those engaged in the battle view the final quality of their goods as an absolute competitive priority. As an upstream partner, they are under immense pressure to produce and ship goods of superior quality in order to win and retain those critical supplier contracts. Companies considering deployment of AI to perform visual inspection, could realistically see a 90% improvement in defect detection and a 50% improvement in manufacturing productivity.
Kubernetes Tutorial: Part 1 — What the Heck Is Kubernetes?
By: Parthasarathy Subburaj
Tags: Docker, Streamlit, Kubernetes, Object Detection, Deployment

Why should you care?

Deploying a machine learning model (or for that matter, any piece of software) into production is one of the most crucial steps in developing AI-based solutions. There is no point in working so hard to create a model that gives you 99.9% accuracy (every ML engineer’s wish 😅) but sits in your sandbox without seeing the limelight 😛. To fully reap the benefits of AI, one should be aware of how to make these models accessible by the end-user at scale, and without much of a hassle.

As discussed at the beginning of this series, Docker-based deployments had taken centre stage roughly about half a decade ago, and they continue to exert their domination in the deployment world. But at the same time, Dockers comes with its own set of drawbacks. Since Dockers run on a single node, it becomes quite tricky to scale up or scale down the application on a need basis without a container orchestration technology. Also, Dockers don’t provide service discovery features nor auto-healing of containers in case if one of them becomes unhealthy nor seamless updates/rollbacks without much of downtime and the list goes on!. And that’s precisely the void which a container orchestration technology tries to fill.

A comic description illustrating the drawbacks of Dockers

When we talk about container orchestration technologies, today we have a plethora of options to choose from, like Amazon Elastic Container Service (ECS), Kubernetes (K8S), Docker Swarn etc., a more elaborate list can be found here. Out of these, K8S is one of the most popular technologies that is open-sourced. At the time this article was written, Kubernetes GitHub repository had over 2800+ developers, and over 94K+ commits were made.

Source: Kubernetes GitHub repository

In this tutorial series we will resort to Minikube, a tool that helps us in running Kubernetes locally with just a single-node, it’s an excellent tool for learning and understanding how Kubernetes works without having to worry about the need to have access to a cluster of nodes.
From Sandbox to K8S: Deploying a Streamlit based object detection application using Minikube
By: Parthasarathy Subburaj
Tags: Python, Streamlit, Kubernetes, Object Detection, Deployment

“Before a software can be reusable, it first has to be usable.”

- Ralph Johnson

Logos of Kubernetes and Streamlit

I am sure every dev-ops engineer out there will truly appreciate how much Docker technology has revolutionized the way people deploy applications by bringing in portability, flexibility, faster software delivery cycles and much more! Gone are the days where enterprises deploy their applications on virtual machines that consume gigabytes of memory and adding unnecessary overheads like setting up dependencies, services and configuration files for each application, thus bloating-up the operational cost. I am quite confident that we are already experiencing the next wave of deployment technology, and that is container orchestration.

In this series of articles, I have put together my experience in working with Kubernetes (K8S). It’s a popular open-source container orchestration technology that was initially developed by the software giant Google and later donated to Cloud Native Computing Foundation which currently maintains it. To be more specific, in this tutorial, we will explore how one can go about deploying a Streamlit based object detection model in Kubernetes. I assume that the readers have a basic working level knowledge on Dockers, if not, please refer to this series, one of the best Docker tutorial series I have read.

Source: Dilbert by Scott Adams

This series is organized into the following sections:

I have made the entire code that will be used as a part of this tutorial in my GitHub repository.

Part 1: What the heck is Kubernetes?
Membuat Sistem Live Object Detection di Swift 5
By: Auriga Aristo
Tags: Coreml, Machine Learning, Swift, iOS, Object Detection

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Kubernetes Tutorial: Part 2 — Streamlit based object detection application
By: Parthasarathy Subburaj
Tags: Docker, Streamlit, Kubernetes, Object Detection, Deployment

Putting them together

Since the primary goal of this tutorial is to understand how one can deploy a machine learning model using K8S, we will restrict ourselves to building a simple application which enables users to select the algorithm they want to run, SSD or YOLO, upload an image for which they want to run the inference and see the predictions of the chosen algorithm.

This is how the welcome page looks like:

Streamlit application welcome page

And this is how it looks when a user runs inference on an image:

Streamlit application after running inference

As of now, this is directly run on my machine, and that’s evident from the localhost:8501 appearing at the top of the web page. Also, when building such an application, we need to take care that the model weights are persisted in memory as soon as the web page loads; this is essential as it prevents the model from loading into memory every time the user uploads an image for inference, this greatly enhances the user experience. We achieve this using the Streamlit’s inbuilt caching mechanism, the @st.cache decorator.

Now we are all set to take this application that is running in a sandbox environment and deploy the same in Minikube after containerization.

Part 3: Familiarizing the environment
Distance Tracker
By: Mini Shail Chhabra
Tags: Socialdistancing, Hackathons, Ghci, Object Detection, Disability

We all have been inside grocery stores and see tape on the floor marking off six feet. And the stickers designating one-way aisles. We’ve seen the photos of people cramming into public spaces — with new rules to follow.

Now, imagine you are blind or have compromised vision. How do you manage to navigate public spaces under the coronavirus restrictions?

Keeping this in mind we tried to build a distance tracker as a part of our project ‘Up-to-the-minute’. In order to determine the distance of the object from the camera we used triangle similarity.

Detector and tracker

The triangle similarity goes something like this: Let’s say we have an object with a known width W. We then place this object some distance D from our camera. We take a picture of our object using our camera and then measure the apparent width in pixels P. This allows us to derive the perceived focal length F of our camera:

F = (P x D) / W

In a similar fashion we have calculated apparent widths of various objects from the CIFAR dataset.

As I continue to move my camera both closer and farther away from the object/marker, I can apply the triangle similarity to determine the distance of the object to the camera:

D’ = (W x F) / P

This D’ is the distance of the object from the camera. If the distance is less than the required distance an alert message is given out.

So the whole scenario works this way, when a person uses camera the object is first detected using YOLOv3 and the the distance of the object is calculated from the camera in live feed. A warning signal is automatically given out if the distance of the person is less than required distance.

Stay tuned for more blogs related to our project…
‘Bridging Visual Representations’ Decoder Integrates CV Object Detection Frameworks
Tags: Neurips 2020, Machine Learning, Artificial Intelligence, Computer Vision, Object Detection

The researchers applied an attention-based decoder module, similar to that in Transformer architectures, to model dependencies between the heterogeneous features. It takes an object detector’s main representations as the query input, while other visual representations enhance the query features with regard to appearance and geometric relationships.

The team says they solved the issue of computation and memory consuming by incorporating two novel techniques — a key sampling approach and a shared location embedding approach — into the BVR module. The module is general, can work in-place, and is convenient to use.

In experiments, BVR was found to be effective with prevalent object detectors RetinaNet, Faster R-CNN, FCOS and ATSS. The researchers applied BVR to each detector and compared their performance to state-of-the-art methods, with BVR achieving 1.5 ∼ 3.0 AP (average precision) improvements.

The team hopes the work will help researchers build better object detection algorithms and benefit object-oriented visual applications. They also caution, as we increasingly see in the CV domain, that care should be taken to avoid issues with biased training data or improper deployment.

The paper RelationNet++: Bridging Visual Representations for Object Detection via Transformer Decoder has been accepted by the 34th Conference on Neural Information Processing Systems (NeurIPS 2020) and is on arXiv. The codes will soon be made available on GitHub.
A Survey Of Deep Learning based Object detection
Tags: Object Detection, Surveys, Deep Learning

Two-Stage detectors

R-CNN:

R-CNN is a region-based CNN detector. This consists of 4 modules.

The first module generates category-independent region proposals. The second module extracts a fixed-length feature vector from each region proposal. The third module is a set of class-specific linear SVMs to classify the objects in one image. The last module is a bounding-box regressor for precisely bounding-box prediction.

Usually, pre-training on a huge dataset is advised. Once pre-trained, we can use that model to train for a specific dataset. This helps to have a fast convergence.

So, the idea in R-CNN divides each image into 2000 regions called selective regions and try to work with those separate regions.

Detailed explanation on this topic can be found in this link

Fast R-CNN

The drawback of R-CNN was there is no information sharing between Conv nets and it takes huge time while computing SVMs for each region. Hence Fast R-CNN was introduced.

Rather than generating 2000 region proposals, Fast R-CNN produces Region of Interest(RoI) using the Max Pooling layer. and only these regions are used in a further operation. Because we are minimizing the area of the image for analysis we will have faster convergence.

Fast R-CNN is a one-stage end-to-end training process using a multi-task loss on each labeled RoI to jointly train the network. Also, the SVM layer is replaced with SVD which fastens the process even further.

Fast R-CNN: Source: Link

Faster R-CNN:

The Region interested in Fast R-CNN was based on a selective search using Max Pooling layers, this was slow. So in Faster R-CNN replaces the region selection method with a novel RPN (region proposal network) that is a fully convolutional network to efficiently predict region proposals with a wide range of scales and aspect ratios.

Faster R-CNN Source: Link

Mask R-CNN

The faster R-CNN performs well, but it has an Instance Segmentation Problem. Mask R-CNN overcomes that problem. First, it generates proposals about the regions where there might be an object based on the input image. Second, it predicts the class of the object, refines the bounding box, and generates a mask in the pixel level of the object based on the first stage proposal.

Because of the above process, it creates a very highly reliable object detection architecture.

Mask R-CNN, Source: Link

Final Segmentated region will look like below:
[Review]데이터 레이블링 효율화를 위한 연구 소개: Deep Interactive Object Selection
Tags: Machine Learning, Segmentation, Computer Vision, Object Detection, Deep Learning

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Rapid Object Detection using a Boosted Cascade of Simple Features
By: Talha Hanif Butt
Tags: Integral Image, Classification, Viola Jones, Attentional Cascade, Object Detection

Rapid Object Detection using a Boosted Cascade of Simple Features

Introduction of a new image representation called the Integral Image which allows the features used by the detector to be computed very quickly.

A learning algorithm, based on AdaBoost, which selects a small number of critical visual features from a larger set and yields extremely efficient classifiers.

A method for combining increasingly more complex classifiers in a cascade which allows background regions of the image to be quickly discarded while spending more computation on promising object-like regions. The cascade can be viewed as an object specific focus-of-attention mechanism which unlike previous approaches provides statistical guarantees that discarded regions are unlikely to contain the object of interest.

Features

Their object detection procedure classifies images based on the value of simple features.

There are many motivations for using features rather than the pixels directly.

The most common reason is that features can act to encode ad-hoc domain knowledge that is difficult to learn using a finite quantity of training data.

Feature based system operates much faster than a pixel-based system.

They use three kinds of features.

The value of a two-rectangle feature is the difference between the sum of the pixels within two rectangular regions.

A three-rectangle feature computes the sum within two outside rectangles subtracted from the sum in a center rectangle.

A four-rectangle feature computes the difference between diagonal pairs of rectangles.

Integral Image

Rectangle features can be computed very rapidly using an intermediate representation for the image which we call the integral image.

The integral image at location x,y contains the sum of the pixels above and to the left of x,y inclusive:

Learning Classification Functions

In their system a variant of AdaBoost is used both to select a small set of features and train the classifier.

The AdaBoost learning algorithm is used to boost the classification performance of a simple (sometimes called weak) learning algorithm.

The key insight is that generalization performance is related to the margin of the examples, and that AdaBoost achieves large margins rapidly.

There are over 180,000 rectangle features associated with each image sub-window, a number far larger than the number of pixels. (24*24)

The weak learning algorithm is designed to select the single rectangle feature which best separates the positive and negative examples.

For each feature, the weak learner determines the optimal threshold classification function, such that the minimum number of examples are misclassified.

The Attentional Cascade

The key insight is that smaller, and therefore more efficient, boosted classifiers can be constructed which reject many of the negative sub-windows while detecting almost all positive instances (i.e. the threshold of a boosted classifier can be adjusted so that the false negative rate is close to zero).

References
Camouflaged Object Detection Using SINet
By: Dylan Hiemstra
Tags: Cod, Artificial Intelligence, Sinet, Object Detection, Deep Learning

Now that a dataset is discussed let’s take a look at the framework itself. It consists out of two main modules: the search module (SM) and the identification module (IM). Both are inspired by hunting. First, a predator will look for a potential prey. If a prey is found, it will be identified and finally be caught.

The Search Module

Just like the human visual system, Receptive Fields(RF) are used to highlight the area close to the retinal fovea, which is a part of the eye that is sensitive to small spatial shifts. This inspired the researchers to use a Receptive Field component that mimics RF of the human visual system. The RF component contains five branches. The first four are concatenated and the fifth branch is added. After that, the whole output of the component is fed through a ReLU function.

Inside look of the RF component[1]

The RF component is used multiple times in the SM, as seen in the image below. The inputs, that originate from Resnet-50, went through multiple convolution layers, down and up-sampling layers and concatenation.

Visual representation of the SM[1]

What is also being used within the SM is the search attention (SA) function, which is, in fact, a Gaussian filter that will later cause an enhanced camouflaged map to be generated.

The Identification Module

After receiving the outputs from the search module, the partial decoder component (PDC) is used to precisely detect the camouflaged object. As shown in the image below, the PDC uses four (one optional) inputs of the SM and the output is a camouflaged object map.

A look into the PDC component[1]

As seen in the complete overview of SINet[1], the PDC is being used twice. The differences between the two are the numbers of inputs it requires to generate the camouflaged object map and the inputs themselves. Both maps are being combined through addition to create the final camouflaged object map.
Quality assurance in motion detection
By: Antti Havanko
Tags: Gitlab, Machine Learning, Data Labeling, Raspberry Pi, Object Detection

Background

As you might have noticed from my previous articles, I have (everlasting) project where I’m building a security camera system for myself. The idea is to use the object detection to spot the intruders on my property and then notify me on my phone. Here are some of my previous articles about this:

Object detection is relatively easy nowadays due to all the pre-trained models but developing the motion detection on top of it turned out to be a bit challenging than I originally thought. Especially to test it without needing to walk in front of the camera every time you make a change.

This is a personal project with a limited amount of resources so I wanted to have an easy way for myself to label images from the cameras so I could have more data to test and improve the system.

I’ll describe next what I did. This consisted of the following steps:

Perform object detection and motion detection Collect data for labeling Label the data Use labeled data for quality assurance and for improving the system

Let’s dive into each step next!

1. Perform object detection and motion detection

I’m using the MobileNet SSD v2 model for object detection. It has been trained with COCO dataset and can recognize 90 different objects which is more than enough for spotting intruders. Or how often you have had a giraffe with bad intentions walking in our backyard? :)

The object detection alone is not enough because I want to get notified only when someone is moving in front of the camera. I’m currently making six detections in 6 seconds and looking at the positions of detected objects in the consecutive detections to remove the static objects. E.g. if my car is parked in the yard.