Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smart library demo #1

Open
wants to merge 1,156 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
1156 commits
Select commit Hold shift + click to select a range
2bf3358
AC: fix IR loading
eaidova Dec 30, 2019
8d8fa72
Merge pull request #750 from eaidova/ea/fix_ir_loading
eaidova Dec 30, 2019
9f8cf1f
2019R4 models RC1
vladimir-dudnik Dec 30, 2019
b25bc0c
Merge pull request #751 from vladimir-dudnik/r4-models-rc1
vladimir-dudnik Dec 30, 2019
021ab29
Merge pull request #693 from vladimir-dudnik/fix-models-docs
vladimir-dudnik Dec 30, 2019
27cf20b
remove old models from test cases
vladimir-dudnik Dec 30, 2019
47eb079
fix binary models subfolder
vladimir-dudnik Dec 30, 2019
b05fbcd
Merge pull request #752 from vladimir-dudnik/fix-test-cases
vladimir-dudnik Dec 30, 2019
ebd2951
AC configs: adopt to new layout (#736)
eaidova Dec 31, 2019
a39dec1
Merge pull request #747 from Wovchena/demos-cnnnetreader-weights
vladimir-dudnik Dec 31, 2019
b6e32c1
Test demos on new reid, update reid with output of 512
Wovchena Jan 9, 2020
b86054e
Merge pull request #758 from Wovchena/reid-models
vladimir-dudnik Jan 9, 2020
161867c
Add colorization
Aug 15, 2019
6790441
Correct data
Dec 6, 2019
1faaa69
Correct data 2
Dec 6, 2019
9f48650
Correct config reader
Dec 6, 2019
7044376
Correct config reader 2
Dec 6, 2019
1cfa78d
Correct config reader 3
Dec 6, 2019
e22f0a1
Correct config reader 4
Dec 6, 2019
4d1fec1
update review
Jan 9, 2020
36d1d3a
AC: update config for brain-tumor-segmentation-0001 (#759)
eaidova Jan 9, 2020
80124ad
Renamed demo's directory
Jan 9, 2020
5956f71
Added models.lst
Jan 9, 2020
0fc1d16
renamed colorization.py
Jan 9, 2020
3ba028f
Update colorization README.md
Jan 9, 2020
fbfeecd
Update colorization demo
Jan 9, 2020
f9aee9b
Update colorization demo 2
Jan 9, 2020
73ba4e8
update demo 3
Jan 9, 2020
fc7823f
update demo 4
Jan 9, 2020
d812ba6
Update config_reader.py
Jan 9, 2020
2b0e822
AC: fix initialization order (#761)
eaidova Jan 10, 2020
75626d7
update demo 5
Jan 10, 2020
892525b
update demo: fixed batch size = 1
Jan 10, 2020
30f80f8
update demo: remove network info
Jan 10, 2020
e9326fb
update demo: renamed exception
Jan 10, 2020
3105c22
All demos are migrated to new API
ilyachur Jan 9, 2020
189ca9e
Add ResNet18 (v1, PyTorch)
vshampor Jan 9, 2020
257ed56
Update models/public/resnet-18-pytorch/model.yml
vshampor Jan 13, 2020
a23dc88
remove custom mean
Jan 13, 2020
c1d7317
Update the upcoming release version
Jan 14, 2020
ead876e
Merge pull request #765 from IRDonch/version
Jan 14, 2020
db3f5af
requirements-pytorch.in: work around a torchvision bug
Jan 14, 2020
cb9718b
update demo: remove scale values
Jan 14, 2020
bde5c21
instance_segmentation: fix
Wovchena Jan 14, 2020
aaefa4b
update demo: rewrite description
Jan 14, 2020
50d9339
update demo: renamed description 2
Jan 14, 2020
2ad8de7
update demo: update README.md
Jan 14, 2020
81b3cbd
Fixed comments
ilyachur Jan 15, 2020
db020cd
add ctc beam search decoder
FengYen-Chang Jan 15, 2020
c150788
Merge pull request #766 from IRDonch/pillow-6
Jan 15, 2020
ce2b746
Fix typo: ouput
Jan 15, 2020
de0b021
Fix typo: embedings
Jan 15, 2020
0233781
Merge pull request #769 from IRDonch/typos
Jan 15, 2020
d83e24a
face-recognition-mobilefacenet-arcface: fix the documented output size
Jan 15, 2020
28f3f0d
AC configs: replace daaset for person-detection-asl-0001 (#772)
eaidova Jan 15, 2020
4a6f98b
Added option to show example of gesture for ASL demo
Jan 13, 2020
88fa398
Initial review
aalborov Jan 15, 2020
45be162
AC configs: set U8 input precision for semantic-segmentation-adas-000…
eaidova Jan 16, 2020
78f71c7
Merge pull request #767 from Wovchena/demos-instance_segmentation-fix
Jan 16, 2020
cc4dc2b
Replace a deprecated MO option with its successor in MO configs
Jan 17, 2020
65b5f0c
Publish new versions of Intel models
Jan 17, 2020
5daf6ca
Merge pull request #778 from IRDonch/replace-deprecated-option
Jan 17, 2020
399459c
AC: fix nifti reader (#779)
eaidova Jan 17, 2020
335c120
Merge pull request #780 from IRDonch/new-models
vladimir-dudnik Jan 17, 2020
d4e0da6
use struct instead class and move to internal, rename paras and func
FengYen-Chang Jan 19, 2020
f27d665
replace 'logic_error' by 'invalid_argument'
FengYen-Chang Jan 19, 2020
c2e6918
use std::min replace if/else
FengYen-Chang Jan 19, 2020
45308a7
update AC config and docs for person-detection-asl-0001
druzhkov-paul Jan 20, 2020
ee98cdc
Update demos/human_pose_estimation_demo/src/human_pose_estimator.cpp
ilyachur Jan 20, 2020
c4c47f6
Merge pull request #771 from IRDonch/arcface-size
Jan 20, 2020
d3007c9
text-image-super-resolution-0001: fix the documented input shape
Jan 17, 2020
efa7c62
use output name from network info
Ilya-Krylov Jan 20, 2020
27fdda5
removed extra normalization as it is done in the network
Ilya-Krylov Jan 20, 2020
cf9531d
Merge pull request #762 from ilyachur/feature/ichuraev/fix_deprecation
Jan 20, 2020
1311808
Merge pull request #783 from IRDonch/tisr-input-size
Jan 20, 2020
48b2d24
Merge pull request #784 from Ilya-Krylov/fix/ik/image_retrieval_demo
Jan 20, 2020
478da1e
patch the string to vector<int> and check the prob_blank to avoid the…
FengYen-Chang Jan 21, 2020
8df3b2b
change bandwith type from int to uint
FengYen-Chang Jan 21, 2020
fae48bf
add ctc description
FengYen-Chang Jan 21, 2020
0de44e7
pedestrian_tracker: disable dyn batch
Wovchena Jan 21, 2020
1e30bab
crossroad_camera: replace person-reidentification-retail 0079 with 0031
Wovchena Jan 21, 2020
fe6c985
Fixed comments
Jan 21, 2020
f5d84f5
Merge pull request #786 from Wovchena/crossroad_camera-update-model-used
Jan 21, 2020
6cf85f9
Fixes
aalborov Jan 21, 2020
a907af3
fix
aalborov Jan 21, 2020
18592ff
Fixed multiple output network processing
Jan 21, 2020
bb5b696
Update product-detection-0001.md
aalborov Jan 21, 2020
1878558
Update text-spotting-0001-detector.md
aalborov Jan 21, 2020
5cb37fa
Update efficientnet-b0-pytorch.md
aalborov Jan 21, 2020
896e4ac
Update efficientnet-b0.md
aalborov Jan 21, 2020
e6f993b
2 more models
aalborov Jan 21, 2020
5d5a121
remove comments and make last candidate as const
FengYen-Chang Jan 21, 2020
319c4c3
add more detail explanation for flag '-b'
FengYen-Chang Jan 21, 2020
bfc2c98
change function softmax
FengYen-Chang Jan 21, 2020
e25e5ca
Update metrics for model 0200
Jan 21, 2020
4559366
AC: fix brain-tumor-segmentation-0002 (#787)
eaidova Jan 22, 2020
21ae030
AC configs: fix missed metrics section in road-segmentation-adas-0001…
eaidova Jan 22, 2020
682f1c0
Merge pull request #785 from Wovchena/pedestrian_tracker-disable-dyn-…
Jan 22, 2020
35e7935
Fixes
aalborov Jan 22, 2020
19f1860
Fixes
aalborov Jan 22, 2020
9b4dceb
Fixes
aalborov Jan 22, 2020
8096303
Fixes
aalborov Jan 22, 2020
df99742
Update text-spotting-0001-detector.md
aalborov Jan 22, 2020
2434738
Merge branch 'develop' of https://github.com/opencv/open_model_zoo in…
Jan 22, 2020
4496075
update model: added accuracy
Jan 22, 2020
7a07067
Fixed comments
Jan 23, 2020
304a69d
fix
aalborov Jan 23, 2020
e9512f1
Merge branch 'develop' of https://github.com/aalborov/open_model_zoo …
aalborov Jan 23, 2020
22bd48c
Merge pull request #773 from aalborov/develop
Jan 23, 2020
9ba0102
update AC: update path format
Jan 23, 2020
274a95a
Merge pull request #763 from evgeny-izutov/feature/ei/asldemo_examples
Jan 23, 2020
b683399
object_detection_demo_centernet: make compatible with NumPy < 1.15
Jan 23, 2020
aeaeb50
single-human-pose-estimation-0001: use correct base dirs in the config
Jan 23, 2020
b8c4d29
Merge pull request #794 from IRDonch/shpe-dl-dir
Jan 24, 2020
8699189
Merge pull request #793 from IRDonch/centernet-flip
Jan 24, 2020
d97e1f2
fix emotions-recognition-retail-0003 naming in description
eaidova Jan 24, 2020
f811196
Merge pull request #796 from eaidova/ea/emotion_recognition_bug
Jan 24, 2020
0488a37
Merge pull request #788 from DmitriySidnev/reid/0200/update_description
vladimir-dudnik Jan 24, 2020
f3df4b8
Merge pull request #782 from druzhkov-paul/update/dp/update_config_fo…
vladimir-dudnik Jan 24, 2020
6432c05
Publish new versions of Intel models
Jan 24, 2020
2e7d42a
Merge pull request #797 from IRDonch/new-models
Jan 24, 2020
8ca4c7a
optimize
FengYen-Chang Jan 25, 2020
00387eb
update accuracy metrics and description
Jan 26, 2020
bf83cb3
demos/monitors: beautify
Wovchena Jan 28, 2020
1d733a0
update demo: update materics value
Jan 28, 2020
7e72be3
Update models/public/colorization-v2-norebal/colorization-v2-norebal.md
Jan 28, 2020
a9e6bd0
Update models/public/colorization-v2/colorization-v2.md
Jan 28, 2020
97f770e
Bump the version for the next release
Jan 29, 2020
45a3159
Remove cpu_extension compatibility code
Jan 24, 2020
b003799
Merge pull request #801 from IRDonch/ver-2020.2
Jan 29, 2020
3fef82a
Merge pull request #768 from FengYen-Chang/CTCBS
Jan 29, 2020
160b881
Merge pull request #802 from IRDonch/bye-cpu-ext
Jan 29, 2020
0f0160d
Merge pull request #760 from opencv/vs/resnet18_config
Jan 29, 2020
3b0a717
demos/object_detection_demo_faster_rcnn: untie DetectionOutputPostPro…
Nov 21, 2019
5f36839
demos/object_detection_demo_faster_rcnn: turn most parameters into co…
Nov 27, 2019
da8ad70
Fixed compilation on CentOS
ilya-lavrenov Jan 30, 2020
fbaad9f
AC: extract formatted result and metric names from presenter (#764)
eaidova Jan 30, 2020
0f6b8fb
AC: integrate Fashion MNIST annotation converter (#781)
eaidova Jan 30, 2020
a32350b
add ac configs
Jan 30, 2020
60afd4d
fix paddings
Jan 30, 2020
ac18a3e
Merge pull request #651 from IRDonch/faster-rcnn-simplification
Jan 30, 2020
8097e43
fixes
Jan 30, 2020
7a01a04
Merge pull request #804 from ilya-lavrenov/il/fix-centos
Jan 30, 2020
898a285
AC: update requirements for numpy
eaidova Jan 30, 2020
13ebb7b
Merge pull request #806 from eaidova/ea/numpy_req
Jan 30, 2020
3437ecb
segmentation: update
Wovchena Jan 30, 2020
54f0ee4
Revert "requirements-pytorch.in: work around a torchvision bug"
Jan 29, 2020
1384c8e
Bump all dependency versions
Jan 29, 2020
c1de131
segmentation: fix for Windows
Wovchena Jan 30, 2020
e5fff87
AC: don't use the deprecated np.matrix class
Jan 30, 2020
6abf68f
segmentation: fix README.md and the test
Wovchena Jan 30, 2020
e26dfab
segmentation: add using namespace InferenceEngine; update README.md
Wovchena Jan 30, 2020
4fd6905
Merge pull request #808 from IRDonch/np-matrix
eaidova Jan 30, 2020
470b2fe
Merge pull request #805 from jkamelin/jk/ac_configs
eaidova Jan 30, 2020
18a6ccd
Merge pull request #803 from IRDonch/dependency-updates
Jan 30, 2020
5cc523b
AC: fix a divide-by-zero warning in AverageMeter
Jan 30, 2020
64d0b7a
Merge pull request #809 from IRDonch/divide-by-zero
eaidova Jan 30, 2020
1b929e8
Update demos/segmentation_demo/main.cpp
Wovchena Jan 30, 2020
ca778c0
add voc2012 without background to dataset definitions
vladimir-dudnik Jan 30, 2020
d22f089
Merge pull request #811 from opencv/dataset_definitions
eaidova Jan 30, 2020
2d0a84e
demos/monitors: fix
Wovchena Jan 30, 2020
bbce8ad
AC: support CIFAR100 dataset
eaidova Jan 31, 2020
081eb75
Merge pull request #812 from eaidova/ea/cifar
eaidova Jan 31, 2020
7106076
Descriptions for public modes are auto updated
eizamaliev Jan 31, 2020
01c5738
R-FCN-Resnet-101 from TensorFlow
eizamaliev Jan 27, 2020
2a46d0d
Merge pull request #800 from Wovchena/demos-monitors-beautify
Jan 31, 2020
c722740
AC: extend NLP support (#757)
eaidova Jan 31, 2020
32d1da5
AC: sharing bitstream from previous run (#777)
eaidova Jan 31, 2020
a1c5894
Model added to index
eizamaliev Jan 31, 2020
f567eea
AC: remove durty hack for channels alignment in launcher (#817)
eaidova Feb 3, 2020
af359e4
segmentation: update comments, add -delay, report latency
Wovchena Feb 3, 2020
30455d4
Merge pull request #815 from eizamaliev/r_fcn
Feb 3, 2020
8d8d5f0
AC: retrun back to numpy 1.17.5 (#819)
eaidova Feb 3, 2020
25d1422
mask_rcnn_demo: use the documented output of the models
Feb 3, 2020
64f57d7
AC: separate dependencies installation (#816)
eaidova Feb 4, 2020
1a79391
AC: support SRGAN (#821)
eaidova Feb 4, 2020
d1c8ac8
add models
Jan 31, 2020
8d12e46
add googlenet v1 config
Feb 4, 2020
7512f9b
add links
Feb 4, 2020
58fb9fe
fix
Feb 4, 2020
4354218
fix paths
Feb 4, 2020
20c31a5
fix paths
Feb 4, 2020
33e5ccd
Fix pillow resize (#824)
eaidova Feb 4, 2020
ca35507
AC: revise result extraction (#822)
eaidova Feb 5, 2020
febea7c
fixes
Feb 5, 2020
e1c65a0
AC: added support numpy files for action recognition (#825)
eaidova Feb 6, 2020
edeaa64
Merge pull request #356 from allnes/an/colorization-net
Feb 6, 2020
f064116
Merge pull request #807 from Wovchena/segmentation-update
Feb 6, 2020
30b7911
Merge pull request #820 from IRDonch/reshape-do-2d
Feb 6, 2020
ba4ab51
demos: Remove unnecessary line continuations
Feb 3, 2020
330202e
demos: fix cppcheck warnings about reducible variable scope
Sep 5, 2019
cb6d7e3
demos: fix performance warnings from Cppcheck
Sep 6, 2019
e6e310a
demos: fix various Cppcheck style warnings
Feb 5, 2020
a2c347a
human_pose_estimation_demo: replace asctime with strftime
Feb 5, 2020
667b47a
demos: drop unused functions
Feb 5, 2020
f5a6b55
Merge pull request #828 from IRDonch/rm-line-continuations
Feb 6, 2020
190de38
security_barrier_camera_demo: make InferRequestsContainer uncopyable
Feb 5, 2020
63c43e3
pedestrian_tracker_demo: remove unused variables
Feb 5, 2020
4540eae
Merge pull request #813 from eizamaliev/doc_update
Feb 6, 2020
3a937e7
Merge pull request #829 from IRDonch/cppcheck
Feb 6, 2020
572ca92
downloader: remove the --config option
Feb 6, 2020
7816495
security_barrier_camera: threadPull->threadPool, update README.md
Wovchena Feb 7, 2020
b305f01
AC: Move the test requirement list to a file
Feb 7, 2020
c9e247f
IMDB annotation for XLNet accuracy test fixes. (#831)
mzuevx Feb 7, 2020
009546c
Merge pull request #832 from Wovchena/security_barrier_camera-wording
Feb 7, 2020
e5f4f47
Merge pull request #830 from IRDonch/rm-big-config
Feb 7, 2020
d3ce8bb
Add a file with pinned versions of Accuracy Checker's test dependencies
Feb 7, 2020
61bc91f
Merge pull request #834 from IRDonch/ac-test-deps
Feb 7, 2020
7f476fa
AC: fix CIFAR100 conversion (#835)
eaidova Feb 8, 2020
5dcebe4
improved docs
Feb 10, 2020
ff4251c
add unet-camvid-onnx-0001 description
vladimir-dudnik Feb 10, 2020
5ce86ae
updates
Feb 11, 2020
3915c64
demos/README.md: fix broken link to the CenterNet demo
Feb 11, 2020
346464a
set tf version
jkamelin Feb 11, 2020
b615028
set tf version
jkamelin Feb 11, 2020
848ad1f
Merge pull request #841 from IRDonch/centernet-link
Feb 11, 2020
7b9f72a
Merge pull request #823 from jkamelin/jk/2020.1_public_models
Feb 11, 2020
6b9680d
AC: Make tests compatible with latest pytest
Feb 11, 2020
f63af44
Update Accuracy Checker test dependencies
Feb 11, 2020
4168307
AC: Set the pytest JUnit report format to 2
Feb 11, 2020
1c25cab
add GFLOPs and MParams info
vladimir-dudnik Feb 11, 2020
0719813
add GFlops/MParams to model description
vladimir-dudnik Feb 11, 2020
00ce7ff
Updated ASL Recognition model to the new one
Feb 12, 2020
3748558
AC: handle paths in tests OS agnostic
eaidova Feb 12, 2020
fbb7d2d
Merge pull request #846 from eaidova/ea/ac_tests_win
Feb 12, 2020
fc8d69b
Merge pull request #844 from IRDonch/update-pytest
Feb 12, 2020
d79d54b
downloader: remove unused function parameters
Feb 12, 2020
88f882f
Replace unintentional Cyrillic C characters with Latin ones
Feb 12, 2020
dd29dac
Replace unnecessary non-ASCII characters with ASCII ones
Feb 12, 2020
d3ab54a
AC: Replace non-ASCII characters with escapes
Feb 12, 2020
2c23c6c
AC: introduce config parameter for isolated location segmentation mas…
eaidova Feb 13, 2020
e5e98ff
Added "cells" parameter to yolo-v2 adapter (#849)
eizamaliev Feb 13, 2020
78703db
AC: fix input transformation for FPGA (#850)
eaidova Feb 13, 2020
5202e3c
downloader: hash files while they're downloading
Feb 12, 2020
d4cf372
Merge pull request #847 from IRDonch/hash-while-downloading
Feb 13, 2020
b2e0554
[Public models]: fix typo in model.yml
eaidova Feb 13, 2020
87fddc8
Merge pull request #851 from eaidova/fix_reverse_input_channel
Feb 13, 2020
c2a3b18
demos: fix the languages specified for code blocks in the docs
Feb 13, 2020
44d302a
AC: fix annotation meta
eaidova Feb 13, 2020
8cf9c46
Merge pull request #839 from vladimir-dudnik/vd/unet-camvid-onnx-0001
Feb 13, 2020
27c05d0
Merge pull request #848 from IRDonch/asciify
Feb 13, 2020
b54fe73
Merge branch 'develop' into sbcd-hddl-hint
Feb 13, 2020
8e5916d
security_barrier_camera_demo/README.md: reformat the VAD hints
Feb 13, 2020
fdb1d41
Merge pull request #854 from IRDonch/sbcd-hddl-hint
Feb 13, 2020
b411dfa
Merge pull request #853 from IRDonch/code-block-langs
Feb 13, 2020
66113be
Add a script to update ci/requirements-*.txt
Feb 12, 2020
5f7949c
Merge pull request #855 from IRDonch/update-reqs
Feb 13, 2020
2256208
fix dummy launcher (#857)
eaidova Feb 14, 2020
ffa43db
Merge pull request #845 from evgeny-izutov/feature/ei/update_aslnet_m…
Feb 14, 2020
a396f5f
Merge branch 'develop' into Smart-Library
FenixFly Feb 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions demos/python_demos/smart_library_demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Smart Library Demo
The applicattion is a demo of automated “smart library”.
It involves the registration of the reader; authorization of the reader through face recognition;
receiving and returning books by recognizing QR codes generated for each book in the library.
The following pretrained models can be used:

* `face-detection-retail-0004`, to detect faces and predict their bounding boxes;
* `landmarks-regression-retail-0009`, to predict face keypoints;
* `face-reidentification-retail-0095`, to recognize readers.

For more information about the pre-trained models, refer to the [model documentation](../../../models/intel/index.md).

### How it works

The application is started from command line. It accepted several parameters.
It reads video stream frame-by-frame from a web-camera device and performs independent analysis
of each frame. To make predictions the application using 3 models. An input frame is processed by
the face detection model to predict face bounding boxes. Then, face keypoints
are predicted by the facial landmarks regression model. Keypoints are using
to align the face and match it with face in data base.
To register in library press `r` on keyboard. Once reader has beeen registered, he will be autothorized
through face recognition. Registration allows to receiving and ruturning books by recognizing QR codes for
each book. To make book recognition press `b` on keyboard. Also applications provides some
extra statictics in console, like list of registered readers, full list of books in the library,
hystory of borrowing books. To change information in console press `f` on keyboard. To exit press `q`.

### Creating QR-codes for books
Next two files are using to create QR-codes for books:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following files are used ...

`library.json` file contains information about books in the library.
`createQRCodes.py` script generates QR-codes for each book in `library.json` file.

usage: createQRCodes.py [-h] [-i LIB] [-o OUT]

optional arguments:
-h, --help show this help message and exit
-i LIB unput `.json` file with info
-o OUT directory to save generated QR-codes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот этот блок или его части не должны быть оформлены как код?


### Installation and dependencies

The demo depends on:
- OpenVINO toolkit (2019R3 or newer)
- Python (any of 2.7+ or 3.4+, which is supported by OpenVINO)
- OpenCV (>=3.4.0)

To install all the required Python modules you can use:

pip install -r requirements.txt


### Running the demo:

Running the application with the `-h` option or without
any arguments yields the following message:

``` sh
python ./smart_library_demo.py -h

usage: smart_library_demo.py [-h] -reid RDDET -m_rd RDMODEL -fd FDDET -m_fd
FDMODEL -lm LMDET -m_lm LMMODEL [-w_rd RDWIDTH]
[-h_rd RDHEIGHT] [-t_rd RDTHRESHOLD]
[-w_fd FDWIDTH] [-h_fd FDHEIGHT]
[-t_fd FDTHRESHOLD] [-w_lm LMWIDTH]
[-h_lm LMHEIGHT] [-br BR] [-lib LIB] [-w WEB]

Smart Library Sample

Optional arguments:
-h, --help show this help message and exit
-w_rd RDWIDTH Optional. Image width to resize
-h_rd RDHEIGHT Optional. Image height to resize
-t_rd RDTHRESHOLD Optional. Probability threshold for face detections.
-w_fd FDWIDTH Optional. Image width to resize
-h_fd FDHEIGHT Optional. Image height to resize
-t_fd FDTHRESHOLD Optional. Probability threshold for face detections.
-w_lm LMWIDTH Optional. Image width to resize
-h_lm LMHEIGHT Optional. Image height to resize
-br BR Optional. Type - QR
-lib LIB Optional. Path to library.
-w WEB Optional. Specify index of web-camera to open. Default is
0

Models:
-reid RDDET Required. Type of recognizer. Available DNN face
recognizer - DNNfr
-m_rd RDMODEL Required. Path to .xml file
-fd FDDET Required. Type of detector. Available DNN face detector -
DNNfd
-m_fd FDMODEL Required. Path to .xml file
-lm LMDET Required. Type of detector. Available DNN landmarks
regression - DNNlm
-m_lm LMMODEL Required. Path to .xml file


Example of a valid command line to run the application:

Linux (`sh`, `bash`, ...) (assuming OpenVINO installed in `/opt/intel/openvino`):

``` sh
# Set up the environment
source /opt/intel/openvino/bin/setupvars.sh

python ./smart_library_demo.py \
-reid='DNNfr' \
-m_rd=<path_to_model>/face-reidentification-retail-0095.xml \
-fd='DNNfd' -m_fd=<path_to_model>/face-detection-retail-0004.xml \
-lm='DNNlm' \
-m_lm=<path_to_model>/landmarks-regression-retail-0009.xml \
```

Windows (`cmd`, `powershell`) (assuming OpenVINO installed in `C:/Program Files (x86)/IntelSWTools/openvino/`):

``` powershell
# Set up the environment
call C:/Program Files (x86)/IntelSWTools/openvino_2019.3.334/bin/setupvars.bat

python smart_library_demo.py -reid='DNNfr' -m_rd=<path_to_model>/face-reidentification-retail-0095.xml
-fd='DNNfd' -m_fd=<path_to_model>/face-detection-retail-0004.xml
-lm='DNNlm' -m_lm=<path_to_model>/landmarks-regression-retail-0009.xml

Notice that the custom networks should be converted to the
Inference Engine format (*.xml + *bin) first. To do this use the
[Model Optimizer](https://software.intel.com/en-us/articles/OpenVINO-ModelOptimizer) tool.

### Demo output

The demo uses OpenCV window to display the resulting video frame and detections.
It outputs logs to the terminal.

## See also
* [Using Inference Engine Demos](../../README.md)
39 changes: 39 additions & 0 deletions demos/python_demos/smart_library_demo/createQRCodes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import sys, os
import argparse
import json
sys.path.append("src/modules")
import QR_generator as qr


def createArgparse():
parser = argparse.ArgumentParser()
parser.add_argument('-i', type=str, dest = 'lib', default='library.json')
parser.add_argument('-o', type=str, dest = 'out', default='qr-codes')
return parser.parse_args()
def main():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это нормально, что функции не отделены пустой строкой, а потом в 16-17 две пустых строки? Надо проверить стиль кодирования.

args = createArgparse()
gen = qr.QRgenerator()


if (args.lib != None and os.path.isfile(args.lib) and args.out != None ):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Удалить пробел после None в конце строки.

try:
os.mkdir(args.out)
except OSError:
print ("Creation of the directory %s failed" % args.out)
else:
print ("Successfully created the directory %s " % args.out)
with open(args.lib, 'r', encoding='utf-8') as lib:
data = json.load(lib)

for book in data['books']:
strData = (str(book['id'])+ ' ' + book['title'] + ' ' +
book['author'] + ' ' + book['publisher'] + ' ' +
str(book['year']))
qr = gen.makeQR(strData)
print(strData)
qr.save(args.out + '/' + str(book['id']) + '.png')
else:
print('File or directory not exists!')

if __name__ == '__main__':
sys.exit(main() or 0)
19 changes: 19 additions & 0 deletions demos/python_demos/smart_library_demo/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"books":
[
{
"id": 1,
"title": "book 1",
"author": "Author 1, Author 2",
"publisher": "pub",
"year": 2018
},
{
"id": 2,
"title": "book 2",
"author": "Author 1, Author 2",
"publisher": "pub",
"year": 2017
}
]
}
5 changes: 5 additions & 0 deletions demos/python_demos/smart_library_demo/models.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file can be used with the --list option of the model downloader.
face-detection-retail-????
face-reidentification-retail-????
landmarks-regression-retail-????

2 changes: 2 additions & 0 deletions demos/python_demos/smart_library_demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyzbar>=0.1.8
qrcode>=6.1
Loading