Load the zmv function, best place is in ~/.zshrc
autoload zmv
Take filenames likes image0001.jpg and rename to 0001.jpg
| #!/usr/bin/env python | |
| import argparse | |
| import json | |
| import os | |
| import sys | |
| import tarfile | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument( | |
| '--image', '-i', required=True, |
| @RunWith(SpringJUnit4ClassRunner.class) | |
| @SpringApplicationConfiguration(classes = {SampleApplication.class}, name = "acceptanceTestContext") | |
| @WebIntegrationTest | |
| public abstract class AbstractAcceptanceTests { | |
| @Autowired | |
| protected JdbcTemplate jdbcTemplate; | |
| /** | |
| * Backs up the database before running this test. |
| #!/usr/bin/env bash | |
| f='/path/to/example.txt' | |
| base="${f##*/}" | |
| echo $base | |
| #=> example.txt | |
| echo "${base%.*}" |
| #!/usr/bin/env zsh | |
| f='example.txt' | |
| echo ${f:r} | |
| #=> example | |
| echo ${f:e} | |
| #=> txt |
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
| import java.util.AbstractList; | |
| import java.util.Iterator; | |
| import java.util.ListIterator; | |
| import java.util.NoSuchElementException; | |
| import org.hibernate.ScrollableResults; | |
| import org.hibernate.Session; | |
| /** | |
| * A List<E> partial wrapper view on an Hibernate ScrollableResults. |
I hereby claim:
To claim this, I am signing this object:
| import logging | |
| import requests | |
| logging.captureWarnings(True) | |
| SERVER = 'my-jenkins' | |
| JOB_FILTER = 'test' | |
| API_TOKEN = '<my-jenkins-api-token>' | |
| USER = 'glombard' |
| export class EnumSymbol { | |
| sym = Symbol.for(name); | |
| value: number; | |
| description: string; | |
| constructor(name: string, {value, description}) { | |
| if(!Object.is(value, undefined)) this.value = value; | |
| if(description) this.description = description; |