Skip to content

Commit e17c4c8

Browse files
committed
add reasoning_visualization_experience.md doc
1 parent 13c9cf8 commit e17c4c8

17 files changed

+123
-7
lines changed
66 KB
Loading
111 KB
Loading
73.2 KB
Loading
52.7 KB
Loading

docs/en/source/design/concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ detection_bbox_data = object_detection_predict(input, detector, is_training=Fals
268268
# 5.Draw the box for the input image and and view it using OpenCV.
269269
detection_image_np = visualize_boxes_on_image(image_np, detection_bbox_data, box_color=(0, 255, 0),
270270
box_thickness=3, text_font=cv2.FONT_HERSHEY_PLAIN,
271-
font_scale=3, text_color=(0, 0, 255), font_size=3, show_scores=True)
271+
font_scale=2, text_color=(0, 0, 255), font_size=3, show_scores=True)
272272
cv2.imshow('object detection image', cv2.resize(detection_image_np, (600, 1000)))
273273
cv2.waitKey(0)
274274
```
@@ -301,7 +301,7 @@ while True:
301301
# 5.Draw the box for the input frame image and view it using OpenCV.
302302
detection_image_np = visualize_boxes_on_image(image_np, detection_bbox_data, box_color=(0, 255, 0),
303303
box_thickness=3, text_font=cv2.FONT_HERSHEY_PLAIN,
304-
font_scale=3, text_color=(0, 0, 255), font_size=3, show_scores=True)
304+
font_scale=2, text_color=(0, 0, 255), font_size=3, show_scores=True)
305305
cv2.imshow('object detection camera', cv2.resize(detection_image_np, (800, 600)))
306306

307307
if cv2.waitKey(25) & 0xFF == ord('q'):

docs/en/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ designed to providing quick-start guidelines for machine learning beginners.
1616
quickstart/overview
1717
quickstart/install
1818
quickstart/quickstart_in_one_minute.ipynb
19+
quickstart/reasoning_visualization_experience
1920

2021
.. toctree::
2122
:maxdepth: 2
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# TinyMS Reasoning Visualization Experience
2+
3+
Combined with OpenCV image vision library, TinyMS V0.3.0 focus visualization features. Through simple and intuitive image visualization, it helps users to understand the effect of model reasoning more quickly.
4+
5+
For users who do not want to write code, TinyMS provides a visual interface of WEB UI. Users only need to upload the image to be inferred on the browser page to experience easily. Currently, it supports for `LeNet5`, `CycleGan` and `SSD300` models.
6+
7+
### WEB UI reasoning visualization
8+
9+
Users need to deploy the visual server first, details please see [TinyMS Nginx Verion Installation](https://tinyms.readthedocs.io/en/latest/quickstart/install.html). After the server is successfully deployed, the home page and reasoning effect page (taking `CycleGan` model as an example) presented by the browser are as follows:
10+
11+
![Index Page](../_static/tinyms_web_index.jpg)
12+
13+
![Predict Page](../_static/tinyms_web_reasoning.jpg)
14+
15+
For users who want to run code, TinyMS provides model reasoning visualization module, which only needs `5` step code to experience quickly. Currently, it only supports `SSD300` object detection model.
16+
17+
### Model reasoning visualization module application
18+
19+
If users need to experience the model reasoning visualization module application for the first time, they can download code from [TinyMS Official Repo](https://github.com/tinyms-ai/tinyms), then do the following operations:
20+
21+
* Static image detection
22+
23+
Note: Please make sure your system has a visual desktop.
24+
25+
```script
26+
# Download the TinyMS project
27+
git clone https://github.com/tinyms-ai/tinyms.git
28+
cd tinyms/tests/st/app/object_detection/
29+
# Run static image detection
30+
python opencv_image_app.py
31+
```
32+
33+
The image to be detected and the image after inference are shown as follows:
34+
35+
![Input Image](../_static/tinyms_visulization_origin.jpg)
36+
37+
![Reasoning Image](../_static/tinyms_visulization_reasoning.jpg)
38+
39+
* Real-time dynamic detection of video images collected by computer camera
40+
41+
Note: In addition to ensuring that your system has a visual desktop, you also need to have a camera.
42+
43+
If using the container to run code, the camera of the host must be mounted to the container. For example, the host is Ubuntu 18.04 with a camera device and a visual desktop. Perform from step 1 to the final. If using the host server, perform from step 4 to the final.
44+
45+
```script
46+
# 1.Install xServer on the host and set permissions
47+
apt install x11-xserver-utils
48+
# 2.Allow all users to access the display interface
49+
xhost +
50+
# 3.Run container
51+
docker run -it --rm --device=/dev/video0 -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix tinyms/tinyms:0.3.0 /bin/bash
52+
# 4.Download the TinyMS project in the container
53+
git clone https://github.com/tinyms-ai/tinyms.git
54+
cd tinyms/tests/st/app/object_detection/
55+
# 5.Run dynamic video image detection collected by camera
56+
python opencv_camera_app.py
57+
```
66 KB
Loading
111 KB
Loading
73.2 KB
Loading

0 commit comments

Comments
 (0)