Skip to content

Instantly share code, notes, and snippets.

View nfedyashev's full-sized avatar

Nikita Fedyashev nfedyashev

View GitHub Profile
@nfedyashev
nfedyashev / README.md
Created March 24, 2016 19:50 — forked from dannguyen/README.md
Using Google Cloud Vision API to OCR scanned documents to extract structured data

Using Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

There Be Dragons

cat /proc/asound/cards
=>/etc/asound.conf
=>$HOME/.mpd/mpd.conf
Monitors: 2
0: +DP-0 2560/597x1440/336+0+0 DP-0
1: +HDMI-0 1920/597x1080/336+2560+0 HDMI-0
➜ ~ xrandr --output DP-0 --left-of HDMI-0
# or
➜ ~ xrandr --output HDMI-0 --left-of DP-0
#see /proc/asound/cards for card num
#cat /etc/asound.conf
pcm.!default {
type plug
slave.pcm "plugequal"
}
pcm.dmixer {
require 'rubygems'
require 'v8'
require 'johnson'
require 'ruby_parser'
sexp=Johnson::Parser.parse %{
var sum=function sum (x,y) {
return x+y
};
➜ rails git:(master) ✗ ag flash'\[' **/*_test.rb
actionpack/test/controller/action_pack_assertions_test.rb
46: flash["hello"] = "my name is inigo montoya..."
310: assert_predicate flash["hello"], :present?
actionpack/test/controller/flash_test.rb
9: flash["that"] = "hello"
24: @flashy = flash["that"]
30: @flashy = flash["that"]
36: @flashy = flash["that"]
a/CHANGELOG.md b/CHANGELOG.md
index f3a07d0..a64a71c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 2019-XX-XX X.Y.Z
+UnobtrusiveFlash stopped making assumptions about your flash keys. unobtrusive_flash_keys has been removed from ApplicationController. If you were overriding it feel free to remove that code.
+
## 2017-06-19 3.3.2
Gem::Specification.new do |s|
s.name = 'leaderbits_stack'
s.version = '0.0.1'
s.authors = ['Nikita Fedyashev']
s.email = 'nfedyashev@gmail.com'
s.required_ruby_version = '>= 1.9.3'
s.description = 'Shared stack configuration'
s.summary = s.description
s.files = ['leaderbits_stack.rb']
@nfedyashev
nfedyashev / Gemfile.shared-stack
Last active March 15, 2019 17:02
Switch to rubygems version for shoulda-matchers
# The goal of this separate gem file is to clearly extract and reuse common Gemfile deps for specific environments
# since env-specific dependency could not be part of *_stack's gemspec it is "duplicated" in both repos
gem 'aws-sdk-s3', '~> 1.30', require: false # for ActiveStorage
gem 'bootsnap', '>= 1.1.0', require: false # Reduces boot times through caching; required in config/boot.rb
gem 'factory_bot_rails'
gem 'faker'
gem 'flutie', github: 'kriskhaira/flutie', branch: 'master' # view helpers by thoughtbot for body class & document title. Fork is for :reverse option
gem 'react-rails', github: 'reactjs/react-rails' # rubygem is rather outdated
gem 'rolify', github: 'RolifyCommunity/rolify', branch: 'master' # user roles