VBoxManage list hdds
VBoxManage modifyhd uui-from-last-step size-in-mb
#to run curl link_to_this_raw_gist | sudo bash | |
sudo apt-get update -y && sudo apt-get upgrade -y | |
sudo apt install curl -y | |
sudo apt-get install tmux -y | |
sudo apt install nodejs -y && sudo apt install npm -y | |
sudo apt-get install htop build-essential zlib1g-dev openssl libreadline6-dev git-core zlib1g libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf automake libtool bison libgecode-dev -y && sudo apt-get install libpq-dev -y | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv && git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
import numpy as np | |
import os | |
import six.moves.urllib as urllib | |
import sys | |
import tarfile | |
import tensorflow as tf | |
import zipfile | |
from collections import defaultdict | |
from io import StringIO |
<div class="jumbotron mb-0"> | |
<h1 class="display-4">Result</h1> | |
<p class="lead">Here is your analysis</p> | |
<hr class="my-4"> | |
<div class="d-block text-center my-4"> | |
<%= link_to 'Analyze another image', root_path, class: 'btn btn-primary btn-lg' %> | |
</div> | |
<% if @analyzed_image&.analyzed_image %> | |
<div class="container-fluid text-center"> | |
<%= image_tag url_for(@analyzed_image.analyzed_image), class: 'img-fluid' %> |
window.addEventListener('DOMContentLoaded', (event) => { | |
const analyzeButton = document.querySelector('#start-analysis'); | |
const loadingButton = document.querySelector('#started-analysis'); | |
console.log(analyzeButton) | |
$("#new_image").submit(function() { | |
analyzeButton.classList.add('d-none') | |
loadingButton.classList.remove('d-none') |
<div class="jumbotron mb-0"> | |
<h1 class="display-4">Image Classifier</h1> | |
<p class="lead">Upload an image for analysis</p> | |
<hr class="my-4"> | |
<%= form_for @image do |f| %> | |
<div class="form-group"> | |
<%= f.label 'Please select an image you would like analyzed' %> | |
<%= f.file_field :captured_image, class: 'form-control-file', id: 'uploaded-image' %> | |
<div class="container text-center my-2"> | |
<img src="" alt="" id="uploaded-image-preview" class="img-fluid w-50"> |
class ImagesController < ApplicationController | |
before_action :image_params, only: [:create] | |
def create | |
analysis_session_token = current_visit.visitor_token | |
path_to_rails = Rails.root.to_s.split('/') | |
path_to_rails.pop | |
image = Image.create(image_params) | |
image.update(analyzing: true) | |
image.captured_image.variant(resize_to_limit: [800, 800]).processed | |
path_to_python = "#{path_to_rails.join('/')}/models/research/object_detection" |
Rails.application.routes.draw do | |
resources :images, only: [:create, :new, :index] | |
root to: "images#new" | |
end |
class ImageAnalysis < ApplicationRecord | |
belongs_to :image | |
has_one_attached :analyzed_image | |
validate :analyzed_image? | |
private | |
def analyzed_image? | |
errors.add(:base, 'Please upload a valid image (PNG, JPG/JPEG).') unless analyzed_image.attached? |
class Image < ApplicationRecord | |
has_one_attached :captured_image | |
has_one :image_analysis, dependent: :destroy | |
validate :captured_image? | |
private | |
def captured_image? | |
errors.add(:base, 'Please upload a valid image (PNG, JPG/JPEG).') unless captured_image.attached? |