mirror of
https://github.com/jomjol/AI-on-the-edge-device-docs.git
synced 2025-12-10 21:46:57 +03:00
Deployed 38bcc2a with MkDocs version: 1.6.1
This commit is contained in:
@@ -827,38 +827,36 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<h2 id="collecting-images-of-your-device"><span class="enumerate-headings-plugin enumerate-heading-plugin">1.2</span> Collecting images of your device</h2>
|
<h2 id="collecting-images-of-your-device"><span class="enumerate-headings-plugin enumerate-heading-plugin">1.2</span> Collecting images of your device</h2>
|
||||||
<p>There are several ways to collect images from your device:
|
<p>There are several ways to collect images from your device:
|
||||||
1. Use the <code>RawImagesLocation</code> parameter to store them directly onto your SD card, see <a href="Parameters/#parameter-rawimageslocation">Parameter <code>RawImagesLocation</code></a>
|
1. Use the <code>RawImagesLocation</code> parameter to store them directly onto your SD card, see <a href="../Parameters/#parameter-rawimageslocation">Parameter <code>RawImagesLocation</code></a>
|
||||||
1. Use the Webhook to send the raw image on each round to a dedicated server, see <a href="Webhook">Webhook</a> resp. <a href="Parameters/#parameter-uploadimg">Parameter <code>UploadImg</code></a>.
|
1. Use the Webhook to send the raw image on each round to a dedicated server, see <a href="../Webhook">Webhook</a> resp. <a href="Parameters/#parameter-uploadimg">../Parameter <code>UploadImg</code></a>.
|
||||||
1. Another option is to pull the images periodically from <code>http://<IP>/img_tmp/raw.jpg</code>. Eg. with an external service. Below is a (Linux)-Bash script to do it:</p>
|
1. Another option is to pull the images periodically from <code>http://<IP>/img_tmp/raw.jpg</code>. Eg. with an external service. Below is a (Linux)-Bash script to do it:
|
||||||
<div class="language-text highlight"><pre><span></span><code> ```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
while [[ true ]]; do
|
while [[ true ]]; do
|
||||||
echo "fetching value..."
|
echo "fetching value..."
|
||||||
wget -q http://192.168.1.151/value -O value.txt
|
wget -q http://192.168.1.151/value -O value.txt</p>
|
||||||
|
<div class="language-text highlight"><pre><span></span><code> value=`cat value.txt`
|
||||||
|
echo "Value: $value"
|
||||||
|
|
||||||
value=`cat value.txt`
|
diff=`diff value.txt value_previous.txt`
|
||||||
echo "Value: $value"
|
changed=$?
|
||||||
|
#echo "Diff: $diff"
|
||||||
|
|
||||||
diff=`diff value.txt value_previous.txt`
|
if [[ $changed -ne 0 ]]; then
|
||||||
changed=$?
|
echo "Value changed:"
|
||||||
#echo "Diff: $diff"
|
echo $diff
|
||||||
|
echo "fetching image..."
|
||||||
|
wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg
|
||||||
|
else
|
||||||
|
echo "Value did not change, skipping image fetching!"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $changed -ne 0 ]]; then
|
cp value.txt value_previous.txt
|
||||||
echo "Value changed:"
|
|
||||||
echo $diff
|
|
||||||
echo "fetching image..."
|
|
||||||
wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg
|
|
||||||
else
|
|
||||||
echo "Value did not change, skipping image fetching!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp value.txt value_previous.txt
|
echo "waiting 60s..."
|
||||||
|
sleep 60
|
||||||
echo "waiting 60s..."
|
done
|
||||||
sleep 60
|
```
|
||||||
done
|
|
||||||
```
|
|
||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
<h2 id="use-prepared-images"><span class="enumerate-headings-plugin enumerate-heading-plugin">1.3</span> Use prepared images</h2>
|
<h2 id="use-prepared-images"><span class="enumerate-headings-plugin enumerate-heading-plugin">1.3</span> Use prepared images</h2>
|
||||||
<p>See the selection below with prepared images.</p>
|
<p>See the selection below with prepared images.</p>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user