#!/bin/sh

sudo apt-get update
sudo apt-get install python3-pip tesseract-ocr python3-opencv build-essential cmake pkg-config libjpeg-dev libtiff5-dev libjasper-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libfontconfig1-dev libcairo2-dev libgdk-pixbuf2.0-dev libpango1.0-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran libhdf5-dev libhdf5-serial-dev libhdf5-103 python3-pyqt5 python3-dev -y

pip3 install -r src/requirements.txt
pip3 install -U numpy
git clone https://github.com/arturaugusto/display_ocr
sudo cp display_ocr/letsgodigital/* /usr/share/tesseract-ocr/4.00/tessdata/
git clone https://github.com/adrianlazaro8/Tesseract_sevenSegmentsLetsGoDigital && cd Tesseract_sevenSegmentsLetsGoDigital
sudo mv 'Trained data'/ /usr/share/tesseract-ocr/4.00/tessdata/
docker-compose up -d
sudo cp solar.service /etc/systemd/system && sudo systemctl enable solar && sudo systemctl start solar
sudo journalctl -fu solar

# UNSORTED
# git clone https://github.com/ljk53/pytorch-rpi && cd pytorch-rpi
# LIBTORCH_VARIANT=armv7l-cxx11-abi-shared-without-deps ./build_libtorch.sh