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 psutil #pip isntall psutil | |
for proc in psutil.process_iter(): | |
if proc.name() == 'firefox.exe': | |
proc.terminate() |
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
FROM ubuntu:20.04 | |
USER root | |
WORKDIR /root | |
SHELL [ "/bin/bash", "-c" ] | |
ARG PYTHON_VERSION_TAG=3.10.5 | |
ARG LINK_PYTHON_TO_PYTHON3=1 |
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 os | |
import random | |
import pathlib | |
from PIL import Image, ImageDraw, ImageFont | |
import icecream | |
def text_to_image(text, font_path, font_size, image_width, image_height, background_color, text_color, path_to_save_image): | |
img = Image.new('RGB', (image_width, image_height), background_color) | |
d = ImageDraw.Draw(img) |
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 os | |
import icecream | |
path = '/home/astraadmin/Desktop/rep/drawing_text_recognition/new/tesseract-tutorial/tesstrain/data/OKBM_NX-ground-truth' | |
def delete_empty_boxes(path): | |
for i, file_name in enumerate(os.listdir(path)): | |
if (i+1)%3==0: | |
full_path_box = path + '/' + file_name | |
#print(file_name) |
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
from fontTools.ttLib import TTFont | |
def is_empty_unicode(path_to_ttf, symbol): | |
font = TTFont(path_to_ttf) | |
cmap = font['cmap'].getBestCmap() | |
unicodes = [chr(k) for k in cmap.keys()] | |
if symbol in unicodes: | |
return True | |
else: | |
return False |
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
./configure LDFLAGS=-lstdc++fs #LDFLAGS нужен при конченых зависимостях компилятора, когда эта сука лаится на make training https://giters.com/tesseract-ocr/tesseract/issues/4200 |
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
#install CMake | |
wget https://github.com/Kitware/CMake/archive/refs/tags/v3.29.2.tar.gz | |
tar -zxvf v3.29.2.tar.gz | |
cd CMake-3.29.2 | |
./bootstrap | |
sudo make install | |
??sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python-dev | |
??sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev | |
#lisb to poppler |
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
#Запустить | |
docker start <name_container> #Запустить контейнер | |
#Войти в БАШ доккер контейнера | |
docker run -it testing_image bash | |
docker exec -it <name_container> bash | |
docker attach <name_container> | |
#Создать Image | |
docker build --tag 'testing_image' . |