-
Review the code for the ocrs-cli crate which is a CLI tool for OCR. Then make a plan to implement a new feature which will allow processing images taken from the system clipboard. The feature should be behind aclipboardCargo feature which is disabled by default. To read from the clipboard, the arboard crate (https://docs.rs/arboard/latest/arboard/) should be used. -
`Implement the following plan:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| import json | |
| import os | |
| import sys | |
| import time | |
| from datetime import datetime, timezone | |
| from typing import List, Dict, Any, Optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <div id="app"></div> | |
| <script type="importmap"> | |
| { | |
| "imports": { | |
| "preact": "https://unpkg.com/preact@10.25.4/dist/preact.module.js", | |
| "preact/hooks": "https://unpkg.com/preact@10.25.4/hooks/dist/hooks.module.js" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import getpass | |
| import json | |
| import re | |
| import sys | |
| import requests | |
| GROUP_URL_PATTERN = "https://hypothes.is/groups/([^/]+)/.*" | |
| api_token = getpass.getpass( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Analysis of Hypothesis Python app routes as part of | |
| # https://github.com/hypothesis/playbook/issues/1797#issuecomment-2397242000. | |
| import os | |
| import ast | |
| import sys | |
| def find_py_files(root_dir): | |
| excluded_dirs = ["node_modules", "build", "test", "tests", "third_party"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Script to fetch and print the transcript for a YouTube video using the | |
| # YouTube Data API v3. | |
| # | |
| # 1. Create a project in the Google API Console | |
| # 2. Enable the YouTube Data API v3 for the new project | |
| # 3. Create credentials for a "Desktop" OAuth client. Download the JSON file | |
| # containing the credentials at the end of the setup process. | |
| # 4. Create a new virtualenv and install dependencies with: | |
| # | |
| # ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <chrono> | |
| #include <iostream> | |
| #include <iterator> | |
| #include <random> | |
| #include <vector> | |
| #include <Accelerate/Accelerate.h> | |
| #include <cblas.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| import argparse | |
| def warp_quadrilateral( | |
| input_path: str, | |
| src_points: list[tuple[int, int]], | |
| output_path: str, | |
| output_size: tuple[int, int], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use ndarray::{Array, Array2, ArrayView, Dim, Dimension, Ix, StrideShape}; | |
| use rten_tensor::prelude::*; | |
| use rten_tensor::{NdTensor, NdTensorView}; | |
| /// Convert an N-dimensional ndarray view to an [NdTensorView]. | |
| /// | |
| /// Returns `None` if the view is not in the standard layout (see | |
| /// [ArrayView::is_standard_layout]). | |
| fn as_ndtensor_view<'a, T, const N: usize>( |
NewerOlder