---
# System prepended metadata

title: Run VIOx on A1M 筆記
tags: [學習, Work]

---

---
title: 'Run VIOx on A1M 筆記'
disqus: hackmd
---

Run VIOx on A1M 筆記
===

## Table of Contents

[TOC]
## Process A1M data
* step1. 上傳 ： 
```C++
mkdir data

sshfs steve@172.19.133.51:/mnt/data/steve/A1M data/
password: 0
``` 
* step2. 登錄 ： 
```C++
ssh steve@172.19.133.51
password: 0
``` 
* step3. 生成image & segmentation ： 
```C++
1. 修改sinet_vio.json
/nnedge/configs/DL/sinet_vio.json
2. run produce script
/nnedge/scripts/
./pro....  ../configs/DL/sinet_vio.json
``` 

## Access A1M data on server
* step1. 在隨意的路徑下 ： 
```C++
mkdir data
``` 
* step2. 連結server ： 
```C++
sshfs steve@172.19.133.51:/mnt/data/steve/A1M data/
password: 0
``` 
![](https://i.imgur.com/um45LT8.jpg)

便可以利用GUI來copy 到自己local端
![](https://i.imgur.com/ih1hdAX.png)



## Run on A1M
```C++
ssh dennis@172.19.134.22
pw: 0
adb devices 
adb -s MTK0001903220243220 shell 
    
/// 丟檔案到matlab那台
sshfs dennis@172.19.134.22:/home/dennis/vio  /home/dennis/Job/1/
adb -s MTK0001903220243220 push vio_system /data/local/tmp/vio/test_viox/
    
    
cd /data/local/tmp/vio/test_viox/
export LD_LIBRARY_PATH=/data/local/tmp/violib

/A55
taskset 1 ./vio_system ../config/vio_config_a1m_0423_g90.json 1619161850035 100000
/A76
taskset 40 ./vio_system ../config/vio_config_a1m_0423_g90.json 1619161850035 100000
/all
taskset ff ./vio_system ../config/vio_config_a1m_0423_g90.json 1619161850035 100000

taskset 40 ./vio_system ../config/vio_config_a1m_0519_g90.json 1621407000000 1200000
    
// take file
adb -s MTK0001903220243220 pull /data/local/tmp/vio/test_viox/cbtn_mem_cpu.txt /home/dennis/vio/
    
scp dennis@172.19.134.22:/home/dennis/vio/cbtn_mem_cpu.txt  /home/dennis/Job/
```

## real time running
* step1. modified code ： 
```C++
1. nnedge : interface / postprocess
2. download models
3.CMake :
install(FILES
  ${CMAKE_SOURCE_DIR}/nnedge/nnmodels/sinet640x512_6cls.tnnmodel
  ${CMAKE_SOURCE_DIR}/nnedge/nnmodels/sinet640x512_6cls.tnnproto
  ${CMAKE_SOURCE_DIR}/nnedge/nnmodels/sinet_6cls_320x256.opt.tnnmodel
  ${CMAKE_SOURCE_DIR}/nnedge/nnmodels/sinet_6cls_320x256.opt.tnnproto
  DESTINATION ${CMAKE_INSTALL_PREFIX}/nnmodels
)
``` 
* step2. build & 壓縮成一包： 
```C++
./viox_cross_compile.bash 
``` 
* step3. 丟到matlab
```C++
other_location sftp://172.19.134.22/
```
* step4. 用command line 將壓縮檔丟到A1M
```C++
ssh dennis@172.19.134.22
adb -s MTK0001903220243220 push viox_a1m.tar.gz /data/local/tmp/vio/

adb -s MTK0001903220243220 pull /data/local/tmp/vio/viox_a1m/bin/ONLINE_process.csv
```
* step5. run on A1M
```C++
adb -s MTK0001903220243220 shell
tar zxvf viox_a1m.tar.gz 

cd /data/local/tmp/vio/viox_a1m/bin
./recorder ../config/vio_config_a1m_g90.json 


export LD_LIBRARY_PATH=/data/local/tmp/vio/viox_a1m/lib
taskset 1 ./vio_system ../config/vio_config_a1m_g90.json 1621406733900 1000           
```
###### tags: `Work` `學習`
