deepgeo

Easy Deep Learning


License
MIT
Install
pip install deepgeo==0.3.1.1909230148a0

Documentation

PostGeoMedia

DeepLearning For PostgreSQL

Information

< Test System Info. >


    CPU : Intel® Core™ i9-7900X CPU @ 3.30GHz x 20
    GPU : TITAN Xp/PCle/SSE2 (CUDA 9.0)
    RAM : 32GB
    OS : CentOS 7 (64bit)
    DB : PostgreSQL 11 ( + plpython3u, PostGIS 2.4, DeepGeoEngine 3.1903141530)
    LIB : Python 3.6 ( + Keras, Tensorflow, CPython, skimage, matplotlib, piexif, PIL, exifread etc.)

Result

Result_deepFind Result_deepCount1 Result_deepCount2

Function Information

< DeepGeo Setting SQL >

# Setup for Engine
#  - Engine raise to memory.
#  - model : The selected model is set as default model.
# return : null
SELECT M_deepSetup(model text);
SELECT M_deepSetup(); # Default Model : mscoco
SELECT M_deepModelList(); # Get Model List
SELECT M_deepClassList(model_name text);
SELECT M_deepClassList(); # 

< Detect SQL >

# Detect 
#  - image detect.
#  - file_url : The file path it want analyze.
#  - model_name : The selected model is set as detect model.
# return : JSON (OR None) 
SELECT M_deepDetect(file_url text, model_name text);
SELECT M_deepDetect(file_url text); # Default Model : mscoco (Depends on the M_deepSetup option.)


# Count Object
#  - Number of Object
#  - file_url : file path it want analyze.
#  - category : Object you are looking for.
#  - model_name : The selected model is set as detect model.
# return : INTEGER
SELECT M_deepCount(file_url text, category text, model_name text);
SELECT M_deepCount(file_url text, category text); # Default Model : mscoco (Depends on the M_deepSetup option.)
SELECT M_deepCount(file_url text); # Number of all object.

 # Find pictures of more than three people.
 SELECT * FROM tb_image WHERE M_deepCount(url, 'person', 'mscoco') >= 3;
 # Find pictures with between 3 cars and 5 cars.
 SELECT * FROM tb_image WHERE M_deepCount(url, 'car') BETWEEN 3 AND 5;
 # Find pictures that have people and cars. 
 SELECT * FROM tb_image WHERE M_deepCount(url, 'car') > 0 AND M_deepCount(url, 'person') > 0;


# All count obejct
#  - All Number of Object
#  - file_url : file path it want analyze.
#  - category : Objects you are looking for.
#  - model_name : The selected model is set as detect model.
# return : JSON
SELECT M_deepCountAsJSON(file_url text, category text, model_name text);
SELECT M_deepCountAsJSON(file_url text, category text); # Default Model : mscoco (Depends on the M_deepSetup option.)
SELECT M_deepCountAsJSON(file_url text); # All category



# Find Object
#  - Find Object
#  - file_url : file path it want analyze.
#  - category : Objects you are looking for.
#  - model_name : The selected model is set as detect model.
# return : JSON
SELECT M_deepFind(file_url text, category text, model_name text);
SELECT M_deepFind(file_url text, category text); # Default Model : mscoco (Depends on the M_deepSetup option.)
SELECT M_deepFind(file_url text); # All category

< Image Data SQL >

# EXIF
SELECT M_deepImgExif(file_url text, key text);
SELECT M_deepImgHeight(file_url text);
SELECT M_deepImgWidth(file_url text);
SELECT M_deepImgAltitude(file_url text);
SELECT M_deepImgDirection(file_url text);
SELECT M_deepImgDistance(file_url text);
SELECT M_deepImgLoc(file_url text); # It will change the name to M_deepImgLocation 
SELECT M_deepImgLocAsJson(file_url text); # It will change the name to M_deepImgLocationAsJson
SELECT M_deepImgVerticalAngle(file_url text);
SELECT M_deepImgViewAngle(file_url text);
SELECT M_deepImgfov(file_url text);
SELECT M_deepImgfov(file_url text, view_angle double precision);
SELECT M_deepImgfov(file_url text, view_angle double precision, distance double precision);
SELECT M_deepImgDate(file_url text);
SELECT M_deepImgTimeStamp(file_url text);

# GET BINARY IMAGE
SELECT M_deepImgfile(file_url text);
SELECT M_deepImgfile(file_url text, model_name text);

< PostGIS >

SELECT M_deepGeoFovIntersection(url text, geo geometry);
SELECT M_deepGeoFovIntersection(url1 text, url2 text);
SELECT M_deepGeoAnnotation(photo stphoto); # It's not support now.

How to install

1. Operation System Install

  • Other

    Go To https://wiki.centos.org/Download

2. PostgreSQL11 Install

  • other

    Go To https://www.postgresql.org/download/

3. Python Lib Install


    pip install tensorflow-gpu, keras, cython, sklearn, matplotlib, piexif, pillow, exifread

4. DeepGeoEngine Install

 
    > su postgres
    > cd /var/lib/pgsql/11/data/
    > wget https://github.com/awarematics/postgeomedia/tree/dg
    > tar -zxvf API3.tar.gz
 
 

5. SQL Insert

 
    Go To https://github.com/awarematics/postgeomedia/blob/dg/sql/01.install/1.install_deepgeo_plpython_function.sql
    Copy ALL
    PostgreSQL New Query And Paste and Run