분류 전체보기

HTML을 Jinja2에서 받아 읽을 때 html 파일 내 "{#"를 주석으로 오인하여 생기는 에러. 원래 html의 주석은 /**/이고, 간혹 shell script가 들어갈 때 문자열이나 배열 길이를 구하기 위해 {#가 들어간다. 이때 jinja2에서는 이 값을 주석의 시작점으로 보고 그 뒤에 들어가는 모든 코드를 다 주석 처리하면서 다음과 같이 end tag가 없다고 판단하는 것이다. 이럴 때는 html 파일 내 {# 를 {{'{#'}}로 바꿔줘야 한다. {# ==> {{ '{#' }} 도움 주신 출처 [Ansible] jinja2 template comment({#) escape Ansible을 사용하서 template 모듈을 사용하면 파일의 중간중간을 변수로 바꿔 넣을 수 있어서 편하다. 이 t..
pdf homepage Jinja — Jinja Documentation (3.0.x) jinja.palletsprojects.com
출처 PDF를 HTML로 변환하는 라이브러리 html 변환 요구사항이 있어 찾아보는데 첫번째로 pdf2htmlEX 라는 것이 걸렸다. 변환 후 깔끔하기로는 이게 최고인 것 같아 더는 안 찾아봤다. https://github.com/coolwanglu/pdf2htmlEX 그런데 이게 활용하기가 threeyears.tistory.com
[layout-parser] Layout Parser layout-parser.github.io https://layout-parser.readthedocs.io/en/latest/index.html Welcome to Layout Parser’s documentation! — Layout Parser 0.3.2 documentation © Copyright 2020-2021, Layout Parser Contributors Revision 29fb2fbd. layout-parser.readthedocs.io https://layout-parser.readthedocs.io/_/downloads/en/latest/pdf/
Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/pdf2image/pdf2image.py", line 441, in pdfinfo_from_path proc = Popen(command, env=env, stdout=PIPE, stderr=PIPE) File "/opt/conda/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/opt/conda/lib/python3.8/subprocess.py", line 1702, in _execute_child..
다른 형식으로된 label txt파일을 내가 원하는 형식 (이미지 경로 + '\t' + Label)으로 바꾸고, 기존 large dataset 중 내가 원하는 일부 이미지만을 다른 폴더에 옮기기 위한 코드 핵심은 shutil package에서 임포트한 copyfile함수 from shutil import copyfile gt_file = open('./new_gt.txt', 'r') label_file = open('./train_label.txt', 'w') lines = gt_file.readlines() new_folder = './Train/mlt_jp/images/' for idx, line in enumerate(lines): print('[%d/%d]'%(idx,len(lines))) fil..
Ubuntu나 Linux에서 Command를 사용해서 파일을 지울 때 rm -r 명령어를 사용한다. 이때, 그 안에있는 ./.git 폴더 내 git 정보까지 삭제하겠냐는 질문이 나온다. 매번 다 y를 입력해줘야 하는데 이런것 자체를 아예 묻지 않게끔 하기 위함 # 강제 삭제 rm -rf ./DIRECTORY_NAME # 모든 대답에 다 yes 입력, 디렉토리 삭제 yes | rm -r ./DIRECTORY_NAME
계속 정리해 나가기 https://backlog.com/git-tutorial/kr/stepup/stepup2_3.html git init git clone ~~ git branch -V : branch 확인 git pull / git pull origin $branch_name : 현재 branch($branch_name)에서 pull git checkout $branch_name : 브랜치 전환하기
· 환경구축
File "sample.py", line 9, in soup = BeautifulSoup(response.content, "lxml") File "/opt/conda/envs/imagemaker/lib/python3.6/site-packages/bs4/__init__.py", line 246, in __init__ % ",".join(features)) bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library? lxml 설치 pip install lxml
· 환경구축
No module named requests pip install requests No module named bs4 from bs4 import BeautifulSoup pip 또는 anaconda 환경에 맞게 설치 pip install BeautifulSoup4 conda install -c anaconda beautifulsoup4 No module named openpyxl pip install openpyxl
# FOR PNG shape import numpy from PIL import Image, ImageDraw # read image as RGB and add alpha (transparency) im = Image.open("crop.jpg").convert("RGBA") # convert to numpy (for convenience) imArray = numpy.asarray(im) # create mask polygon = [(444,203),(623,243),(691,177),(581,26),(482,42)] maskIm = Image.new('L', (imArray.shape[1], imArray.shape[0]), 0) ImageDraw.Draw(maskIm).polygon(polygon,..
논문 논문을 깊게 읽고 만든 자료가 아니므로, 참고만 해주세요. 얕은 지식으로 모델의 핵심 위주로만 파악한 자료이다 보니 없는 내용도 많습니다. 혹시 사용하실 경우 댓글 부탁드립니다. - 참고 블로그 RNN, OCR , Scene Text 2021.03.11 Read Like Humans: Autonomous, Bidirectional and Iterative Language Modeling for ... blog.naver.com
https://github.com/open-mmlab/mmocr GitHub - open-mmlab/mmocr: OpenMMLab Text Detection, Recognition and Understanding Toolbox OpenMMLab Text Detection, Recognition and Understanding Toolbox - GitHub - open-mmlab/mmocr: OpenMMLab Text Detection, Recognition and Understanding Toolbox github.com 1 . 데이터 전환(준비) 기존 LMDB format 데이터 -> image + Label based txt 로 변환 단순 코드 [LMDB] lmdb file loading, readi..
LMDB 안에 image와 label이 있다는 가정하에 로딩, txt파일의 경우 다음과 같은 형식으로 생성됨(여기서 구분자는 \t 사용) import lmdb from tqdm import tqdm import six from PIL import Image import os from glob import glob import concurrent.futures from concurrent.futures import ProcessPoolExecutor import functools import time def make_txt_lst_dict(data_dir_lst): txt_dict = {} txt_lst = [] for idx, data_dir in enumerate(data_dir_lst): if dat..
Js.Y
'분류 전체보기' 카테고리의 글 목록 (12 Page)