File Upload (Python) and Download (PHP)

I had an opportunity to upload files to a server, so this is a memo of the process. The image receiving program running on the server was created in PHP. Please be careful about security. upload.php < ? ? > p $ $ $ i } m h r p d f o p o a i v o t r ( e t h n ! m _ a f k u = = m i d p e l i l " $ e r o . _ = _ ( a / P e $ d " O d x d e ; S i i i d T r s r _ [ n t n f " a s a i p m ( m l C a e $ e e h t ( d , ( a h $ i $ n " p r 0 _ g ] a n 7 F e ; t a 5 I h m 5 L a ) e , E s ; ) S ) t [ a r ' p { u m p e e r ) d o ; i p a r ' i ] a [ t ' e t . m p _ n a m e ' ] , $ r o o t . $ p a t h ) ; The program to upload files via POST was created in Python. It posts the local image file and the output destination path. ...

June 3, 2022 · 3 min · Nakamura

Creating Microsoft Word Files with python-docx: Using Templates and int2kanji

Overview I had the opportunity to convert information managed in a tabular format into a vertical-writing Microsoft Word format, so here are my notes. Before conversion: Research Project Title Project Number Direct Costs Development of Digital Archive System Construction Methods Considering Sustainability and Reusability 21K18014 2600000 After conversion: The implementation uses a specified template and the “Kanjize” library for mutual conversion between numbers and kanji numerals. Creating Microsoft Word Files with python-docx First, create a Microsoft Word template file like the following. While using the specified layout, place {<variable_name>} in the parts where values should be changed. ...

May 31, 2022 · 5 min · Nakamura

Execution Time for NDLOCR Using Google Colab

I recently wrote the following article: This time, I conducted a brief investigation on the execution time of NDLOCR using Google Colab, and here are the results. Configuration The GPU used was: F r = = i N G F = N P = V P a = / r G = N A I U n = 0 A o P = o p D = c U = r I = e = r A N T = T s = u 2 - a e = e 3 s = n 9 S m m = s 5 e G I = n M e p = l C s I D = i 0 I = a : = n 6 = = g : 4 P = V = 2 6 e = 1 C I = p 6 0 r = 0 P I D = r : . f = 0 0 = o 2 3 = - = c 9 2 = S = e . P P = X = s 2 0 e w = M = s 0 3 r r = 2 2 = e 2 s : = . 3 = s 2 i U = . W = s s = . P = f t a = / I = o D e g = D = u r n e = O 3 = n i c / = f 0 = d v e C = f 0 = e - a = W T = r M p = y = p = V = e = e B = 0 = r u = 0 = s s = 0 = i - = 0 P = o I = 0 r = n d = 0 0 o = : = 0 M c = = 0 i e = 4 M = : B s = 6 e = 0 s = 0 m = 0 / = . o = : n = 3 r = 0 1 a = 2 y = 4 6 m = . D - = . 1 e = 0 i U = 0 6 = 3 s s = 0 = p a = O M = . g = f i = A e = f B = = = C = U = = D V G = = A o P = = l U = = V a - = = e t U = = r i t = 0 = s l i = % = i e l = = o = = n U = = : n C = G U = c o = P s = 1 o m = U a = 1 r p = D g = . r u M = e M e = 2 . t I = f e = e G = a m = E = u N o = C M M = l / r = C . . = 0 t A y = = = The following image was used. The size was 5000 x 3415 px, 1.1 MB: ...

April 29, 2022 · 6 min · Nakamura

Example of Running SPARQL Queries Against the Japan Search RDF Store Using Google Colab

I created a notebook demonstrating examples of running SPARQL queries against the Japan Search RDF store using Google Colab. I hope it serves as a useful reference when using RDF stores with Python. https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/ジャパンサーチのRDFストアを対象したSPARQLチュートリアル.ipynb Other reference sites and tutorials include the following. https://www.kanzaki.com/works/ld/jpsearch/ https://lab.ndl.go.jp/data_set/tutorial/

April 29, 2022 · 1 min · Nakamura

Building an Object Detection API Using AWS Lambda (Flask + YOLOv5)

Overview We build an object detection API (Flask + YOLOv5) using AWS Lambda. By building a machine learning inference model using AWS Lambda, we aim to reduce costs. The following article was used as a reference. https://zenn.dev/gokauz/articles/72e543796a6423 Updates to the repository contents and additions of how to use it from API Gateway have been made. Registering Functions on Lambda Clone the following GitHub repository. g i t c l o n e h t t p s : / / g i t h u b . c o m / l d a s j p 8 / y o l o v 5 - l a m b d a . g i t Running Locally Next, create a virtual environment using venv and install the modules. ...

March 24, 2022 · 5 min · Nakamura

[Google Colab] Retrieving Article Lists Using the Hatena Blog AtomPub API

I created a sample program for retrieving article lists using the Hatena Blog AtomPub API. You can try it on the following Google Colab. https://colab.research.google.com/drive/15z0Iime9Bbma7HW09__Fq_fRkcWP6nyS?usp=sharing After running the above program, an Excel file like the following will be downloaded. https://docs.google.com/spreadsheets/d/14myDqZTxocwOT0Mw3ZzKLO81E6r15R-49oUh2dG9Rbo/edit?usp=sharing The “metadata” sheet stores blog information, and the “items” sheet stores the list of articles. Some aspects may be unclear due to the notation in column A of the “metadata” sheet, the heading rows, and the heading rows of the “items” sheet (which are designed for connection with other applications), but I hope this is helpful when using the Hatena Blog AtomPub API. ...

March 22, 2022 · 1 min · Nakamura