640 likes | 658 Views
AI for Beginners from a Beginner. About me. AI beginner tomas@florian.ca IT Consulting Complex networking Cloud / Virtualization systems Cyber security. Demos. What got me started down this path is impressive demos that I’ve seen in the last couple of years. Question.
E N D
About me • AI beginner • tomas@florian.ca • IT Consulting • Complex networking • Cloud / Virtualization systems • Cyber security
Demos • What got me started down this path is impressive demos that I’ve seen in the last couple of years
Question • Can anybody do this with now with open source software? • Yes
Lay of the Land End user apps CLI apps Frameworks Libraries Research Open Source Closed Cloud
Lay of the Land End user apps CLI apps Frameworks Libraries Research Open Source Closed Cloud
Lay of the Land End user apps CLI apps Frameworks Libraries Research Open Source Closed Cloud
Lay of the Land End user apps CLI apps Frameworks Libraries Research Open Source Closed Cloud
Lay of the Land End user apps CLI apps Frameworks Libraries Research Open Source Closed Cloud
2x Demo • Show • Unwrap • Howto • Questions • Navigating Limits of AI • Questions
Unwrap: Black Box ./flow --imgdirsample_img/ --model cfg/yolo.cfg --load bin/yolo.weights
Neural Network ./flow --imgdirsample_img/ --model cfg/yolo.cfg --load bin/yolo.weights
Neural Network Model Weights (pre-trained) ./flow --imgdirsample_img/ --model cfg/yolo.cfg --load bin/yolo.weights
Darkflow Dependency Stack OpenCV TensorFlow model weights Python3 darkflow Anaconda Ubuntu 18.04 VM i7 CPU, 4 GB RAM
Howto • git clone https://github.com/thtrieu/darkflow • Create conda virtual env for the project • conda create -n NAME python=3.6 • source activate NAME • Install dependencies • conda install tensorflowcythonnumpy • Add the repo with particular opencv version • condaconfig --add channels conda-forge • Install opencv • conda install opencv • Run setup • python3 setup.py build_ext --inplace • Download weight file for the model • https://drive.google.com/drive/folders/0B1tW_VtY7onidEwyQ2FtQVplWEU and place it in bin/ • Run • ./flow --imgdirsample_img/ --model cfg/yolo.cfg --load bin/yolo.weights
GAN Generative Adversarial Network Pre trained generator network
Transparent Latent GAN Pretrained network model Transparent latent GAN Python3 CUDA toolkit cuDNN Jupyter Anaconda Ubuntu 16.04 VM 2 CPU,6 GB RAM, K80 GPU with 12GB RAM,50 GB Disk
Howto • Git clone https://github.com/SummitKwan/transparent_latent_gan.git • Prepare anaconda • conda create -n NAME python=3.6 • source activate NAME • cdtransparent_latent_gan • Install dependencies • conda install pip • pip install -r requirements.txt • conda install cudatoolkit • conda install cudnn • conda install jupyter • Download pre-trained model https://www.dropbox.com/sh/y1ryg8iq1erfcsr/AAB--PO5qAapwp8ILcgxE2I6a?dl=0 (extract to same folder structure) • Run notebook • jupyter notebook • Navigate to URL shown at startup + notebooks/transparent_latent_gan/src/notebooks/tl_gan_ipywidgets_gui.ipynb • Run notebook
Hardware Notes • Google Compute Engine preemptive K80 ~$0.20 CAD / Hour • I used vanilla Ubuntu 16.04 and installed Nvidia drivers on it myself • Prebuilt images but more $ per hour (not preemptive) • REMEMBER TO TURN IT OFF • Nvidia GX 1060 (6 GB RAM … more is better) $300 • Nvidia-smi
Expectations • 80% of time dealing with building the stack • Poor documentation • Missing/incompatible pre-trained models • Dependency hell (much better with Anaconda) • Unhelpful error messages • 20% real AI work
Path of least resistance • Anaconda • cuDNN 7 • CUDA toolkit 9 • Ubuntu 16.04 • nVIDIA GPU > 6 GB RAM
CSI Zoom and Enhance for real • https://github.com/alexjc/neural-enhance
We look up the registered owner • Cops go out • Shoot the guy • CSI Calgary saves the day • Case closed
Different model will CONVINCINGLY lead you to a different conclusion
Which license plate was it? • Maybe URL 937 • Maybe BBL 3698 • Maybe SOMETHIN ELSE • Even though we are seeing it in front of our own eyes there is a threshold at which AI can just make stuff up and make it look like the real thing