OpenCV Practice Repository https://github.com/AmitThakur/opencvp.git
Credits: [http://www.raben.com/book/export/html/3] [http://karytech.blogspot.in/2012/05/opencv-24-on-ubuntu-1204.html]
| #!/bin/sh | |
| #Check the Drive Space Used by Cached Files | |
| du -sh /var/cache/apt/archives | |
| #Clean all the log file | |
| #for logs in `find /var/log -type f`; do > $logs; done | |
| logs=`find /var/log -type f` | |
| for i in $logs |
| import json | |
| import argparse | |
| import copy | |
| def load_json(file_name): | |
| file = open(file_name, 'r').read() | |
| return json.loads(file) | |
| #Get PPA repo drivers and Install CUDA 10.0 | |
| curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.0.130-1_amd64.deb | |
| sudo dpkg -i cuda-repo-ubuntu1604_10.0.130-1_amd64.deb | |
| sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
| sudo apt-get update | |
| sudo apt-get install cuda-10-0 cuda-drivers -y | |
| #Install cuda-compatibility 10.0 | |
| sudo nvidia-smi -pm 1 | |
| sudo apt-get install cuda-compat-10.0 |
| ## Paketler yüklü değilse install.packages kullanın | |
| ## install.packages(c("tidyverse","jsonlite"),repos="https://cran.r-project.org") | |
| library(tidyverse) | |
| library(jsonlite) | |
| ispark_query_url <- "https://data.ibb.gov.tr/api/3/action/datastore_search_sql?sql=SELECT%20*%20from%20%22c3eb0d72-1ce4-4983-a3a8-6b0b4b19fcb9%22" | |
| raw_value <- fromJSON(ispark_query_url) | |
| raw_df <- raw_value$result$records %>% rename_all(~gsub("^_","",.)) %>% rename_all(~gsub(" |\\(|\\)|/","_",.)) %>% tbl_df() |
| import numpy as np | |
| from scipy.interpolate import RectBivariateSpline as Spline | |
| import pygeodesy as geo | |
| from pygeodesy.ellipsoidalVincenty import LatLon | |
| class Geoid12B(): #NAD 83 Ellipsoid | |
| # https://www.ngs.noaa.gov/GEOID/GEOID12B/GEOID12B_CONUS.shtml | |
| # Download a Geoid Grid in little endian binary format ('g2012bu5.bin') | |
| def __init__(self, leBinFile): | |
| glamn, glomn, dla, dlo = np.fromfile(leBinFile,'<f8',4) |
| import os | |
| import datetime | |
| import numpy as np | |
| os.environ['KERAS_BACKEND'] = 'theano' | |
| os.environ['THEANO_FLAGS'] = \ | |
| 'mode=FAST_RUN,device=cuda0,floatX=float32,optimizer=None' | |
| import keras as ks | |
| import os | |
| # We'll render HTML templates and access data sent by POST | |
| # using the request object from flask. Redirect and url_for | |
| # will be used to redirect the user once the upload is done | |
| # and send_from_directory will help us to send/show on the | |
| # browser the file that the user just uploaded | |
| from flask import Flask, render_template, request, redirect, url_for, send_from_directory | |
| from werkzeug import secure_filename | |
| # Initialize the Flask application |
OpenCV Practice Repository https://github.com/AmitThakur/opencvp.git
Credits: [http://www.raben.com/book/export/html/3] [http://karytech.blogspot.in/2012/05/opencv-24-on-ubuntu-1204.html]
| class DotDict(dict): | |
| """dict class that allows you to access values by dot notation""" | |
| def __init__(self,arg): | |
| for k in arg.keys(): | |
| if (type(arg[k]) is dict): | |
| self[k]=DotDict(arg[k]) | |
| else: | |
| self[k]=arg[k] | |
| def __getattr__(self, attr): |