In the name of God
This gist contains steps to setup Ubuntu 22.04 for deep learning.
| extension Array where Element == OCRCandidate { | |
| func sortCandidates() -> [OCRCandidate] { | |
| self.sorted { (currentCandidate, nextCandidate) -> Bool in | |
| let currentCandidateBottomY = currentCandidate.boundingPoints.avgBottomY | |
| let nextCandidateBottomY = nextCandidate.boundingPoints.avgBottomY | |
| if currentCandidateBottomY < nextCandidateBottomY { | |
| // Rounding item for discrepancies with Y positions. | |
| let difference = (currentCandidateBottomY - nextCandidateBottomY).roundTo2dp |
| private func ocrRequestHandler(request: VNRequest, error: Error?) { | |
| guard let observations = request.results as? [VNRecognizedTextObservation] else { return } | |
| var ocrCandidates: [OCRCandidate] = [] | |
| for observation in observations { | |
| guard let topCandidate = observation.topCandidates(1).first else { return } | |
| // Vision algorithms use a coordinate system with lower left origin. | |
| // Converting to upper left so the y values are increasing as the bounding box for observation | |
| // goes down the list as to how humans read english text. |
| #!/bin/bash | |
| #Jason T. 2-6-2018 | |
| # Check specifically for the run command | |
| if [[ $# -ge 2 && $1 == "run" ]]; then | |
| # Tell docker to share the following folders with the base system | |
| # This allows the docker containers to find CUDA, cuDNN, TensorRT | |
| LIB_MAPS="/usr/lib/aarch64-linux-gnu \ | |
| /usr/local/cuda \ | |
| /usr/local/cuda/lib64" |
| <section id="cd-timeline" class="cd-container"> | |
| <div class="cd-timeline-block"> | |
| <div class="cd-timeline-img cd-picture"> | |
| </div> | |
| <div class="cd-timeline-content"> | |
| <h2>Penta Consulting</h2> | |
| <div class="timeline-content-info"> | |
| <span class="timeline-content-info-title"> | |
| <i class="fa fa-certificate" aria-hidden="true"></i> |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Collections; | |
| using UnityEditor; | |
| using UnityEngine; | |
| using System; | |
| using System.Threading; | |
| public class Utilities : EditorWindow | |
| { |
| import numpy as np | |
| def computeIoU(y_pred_batch, y_true_batch): | |
| return np.mean(np.asarray([pixelAccuracy(y_pred_batch[i], y_true_batch[i]) for i in range(len(y_true_batch))])) | |
| def pixelAccuracy(y_pred, y_true): | |
| y_pred = np.argmax(np.reshape(y_pred,[N_CLASSES_PASCAL,img_rows,img_cols]),axis=0) | |
| y_true = np.argmax(np.reshape(y_true,[N_CLASSES_PASCAL,img_rows,img_cols]),axis=0) | |
| y_pred = y_pred * (y_true>0) | |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Copyright 2016 Massachusetts Institute of Technology | |
| """Extract images from a rosbag. | |
| """ | |
| import os | |
| import argparse |
This is a comparison of packaging with python vs with npm.
Python packaging is 3x as complex as javascript packaging. See the conclusion for more detail (but less than the whole document).