|
| 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 | + |
| 12 | + |
| 13 | + |
| 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 | + |
| 36 | + |
| 37 | + |
| 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 | +``` |
0 commit comments