Skip to content

Tsugawa007/SocialDistance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important Notice(2021/10/27)

2021年の10月に開催されているIntel® AI Global Impact Festivalという世界的なオンライン祭典の、competeというジャンルの AI Impact Creators部門で日本代表として国に選ばれました。 そして、その AI Impact Creators部門でファイナリストとして選出されました。

下の英文の下のURLは、Intel® AI Global Impact Festivalで私の作品が展示されている実際の様子です

I was selected to represent my country in the AI Impact Creators category of the Intel AI Global Impact Festival, a global online festival held in October 2021, in the category of "compete". And I was selected as a finalist in the AI Impact Creators category.

The URL below is the actual scene of my work being displayed at the Intel® AI Global Impact Festival.

https://drive.google.com/file/d/1XpuswL82JC60-36XVGu0RpOAo5WNcSCG/view

(2021/2/10) I erased the function of mosaic processing.

モザイク 処理を廃止しました。 人々の最小y座標を比べて、奥行きを計算するようにしています。


English version


A Social distance program that is easier and faster to make!

This is a program that measures Social distance for 30 seconds using AI CORE X. If you have no AI expertise,You can make it quickly using python.

What is AI CORE X? :https://jellyware.jp/aicorex/

(Sorry, the website is written in Japanese. Please translate with Google Translate and read it)



Envioroment

・AI CORE X

・OpenVino version is " 2020 1" (OpenVin is pre-installed in AI CORE X)

Feature

If pedestrians violate Social Distance momentarily, it will turn green, and they violate it for 30 seconds, it will turn red.


Picture Picture



About AI models

I used two Intel AI models.

Human identification(person-detection-retail-0013) https://docs.openvinotoolkit.org/2018_R5/_docs_Retail_object_detection_pedestrian_rmnet_ssd_0013_caffe_desc_person_detection_retail_0013.html

Individual identification(person-reidentification-retail-0200) https://docs.openvinotoolkit.org/2020.1/_models_intel_person_reidentification_retail_0200_description_person_reidentification_retail_0200.html



Postive points

I applied mosaic processing to the video. In addition, the Program performe not only instantaneous detection but also detection after 30 seconds.



Points I want to improve in the future

Using existing AI models has limited accuracy. Also, the calculation method of Social distance of this program is a simple Euclidean matrix distance. I would like to create an AI model by myself and use 3D coordinate transformation (adding the z coordinate of depth to the x and y coordinates of the video) to improve the accuracy.



Execution procedure

[Caution] If the device and OpenVino version are different from the one I'm using, You need to change the AI model used and the AI model configuration code.


1. Download the two AI models (.xml file, .bin file).

# Download model(person-detection-retail-0013) into a directory
curl --create-dirs https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-detection-retail-0013/FP16/person-detection-retail-0013.xml https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-detection-retail-0013/FP16/person-detection-retail-0013.bin -o model/person-detection-retail-0013.xml -o model/person-detection-retail-0013.bin

# Download model(person-reidentification-retail-0200) into a  directory
https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-reidentification-retail-0200/FP16/person-reidentification-retail-0200.xml https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-reidentification-retail-0200/FP16/person-reidentification-retail-0200.bin -o model/person-reidentification-retail-0200.xml -o model/person-reidentification-retail-0200.bin

2. Rewrite "$(pwd)" on the 20th line of sample.py to the full path of the current directory.


  1. Customize "Social_parameter" on line 28 of sample.py. Because it is not the actual Social Distance distance, but the x and y coordinate distance of the video.

4. Run sample.py


日本語version


学生でも作成できる!お手軽SocialDistanceプログラム

AI CORE X を使用して、30秒間のSocialDistanceを計測するプログラムです。 AIの専門知識がなくても、pytonを使用して、短期間で、作成できます。

AI CORE Xとは? :https://jellyware.jp/aicorex/



特徴

瞬間的にSocialDistanceを違反したら緑色、30秒間違反したら赤くなります。


静止画 静止画



AIモデルについて

Intelの二つのAIモデルを使用しました。

人間識別(person-detection-retail-0013) https://docs.openvinotoolkit.org/2018_R5/_docs_Retail_object_detection_pedestrian_rmnet_ssd_0013_caffe_desc_person_detection_retail_0013.html

個別識別(person-reidentification-retail-0200) https://docs.openvinotoolkit.org/2020.1/_models_intel_person_reidentification_retail_0200_description_person_reidentification_retail_0200.html



工夫した点

モザイク処理をかけたました。

瞬間的な検知だけではなく、一定時間の検知も行いました。



今後改善したいところ

既存のAIモデルを使用すると、精度に限界があります。 また、SocialDistaceの計算方法も、単純なユークリッド行列距離をしています。 今度同じ様なご機会を貰えたならば、自分でAIモデルを作成し3次元座標変換(写真のx,y座標に、奥行きのz座標を付与する)を使用して精度をもっと良くしていきたいです。



実行手順

[注意] このプログラムは、AI CORE X(デバイスは"MYRIAD"、OpenVinoのversionは"2020年1")を使用した、Social_Distanceプログラムです。 よって、デバイス、OpenVinoのversionが異なると、使用するAIモデル、AIモデルのSettingのコードを変更する必要があります。 その点を、踏まえてコードをご覧になって頂くと、幸いです。


1. 2個のAIモデル(.xml ファイル、.binファイル)をDownloadします。

# Download model(person-detection-retail-0013) into a directory
curl --create-dirs https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-detection-retail-0013/FP16/person-detection-retail-0013.xml https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-detection-retail-0013/FP16/person-detection-retail-0013.bin -o model/person-detection-retail-0013.xml -o model/person-detection-retail-0013.bin

# Download model(person-reidentification-retail-0200) into a  directory
https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-reidentification-retail-0200/FP16/person-reidentification-retail-0200.xml https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/person-reidentification-retail-0200/FP16/person-reidentification-retail-0200.bin -o model/person-reidentification-retail-0200.xml -o model/person-reidentification-retail-0200.bin

2. sample.pyの20行目の"$(pwd)"をカレントディレクトリのフルパスに書き換えます。


3.sample.pyの28行目の"Social_parameter"をカスタマイズします。 実際のSocialDistanceの距離ではなく、画像のx、y座標の距離となっています。 なので、実際に動かしながら、調整をしました。

4. sample.pyを実行する

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages