Skip to content

Commit

Permalink
Merge pull request #3 from maeriil/imagedetect
Browse files Browse the repository at this point in the history
Image Detection and Translation
  • Loading branch information
maeriil authored Jan 16, 2024
2 parents e4eeba3 + f498969 commit 67d9427
Show file tree
Hide file tree
Showing 48 changed files with 2,628 additions and 229 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "black"
}
3 changes: 3 additions & 0 deletions backend/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = E203,W503

20 changes: 20 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# project specific ignore files/folder
*.png
*.jpg
*.txt
results
images

# Byte-compiled / optimized / DLL files
**/__pycache__/
__pycache__/

# Sphinx documentation
docs/_build/

# Environments
.env
.venv
env/
venv/
ENV/
15 changes: 15 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Aoriil Backend

# Project Description

# Installation

# Example Usage

# Dev setup

# Change Log

# License

# Contributing
Binary file removed backend/backend/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed backend/backend/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file removed backend/backend/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file removed backend/backend/__pycache__/wsgi.cpython-311.pyc
Binary file not shown.
16 changes: 0 additions & 16 deletions backend/backend/asgi.py

This file was deleted.

123 changes: 0 additions & 123 deletions backend/backend/settings.py

This file was deleted.

23 changes: 0 additions & 23 deletions backend/backend/urls.py

This file was deleted.

16 changes: 0 additions & 16 deletions backend/backend/wsgi.py

This file was deleted.

20 changes: 20 additions & 0 deletions backend/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
32 changes: 32 additions & 0 deletions backend/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import os
import sys

project = "Aoriil"
copyright = "2023, maeriil"
author = "maeriil"
release = "0.0.1"

sys.path.insert(0, os.path.abspath("../../src"))

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
20 changes: 20 additions & 0 deletions backend/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. Aoriil documentation master file, created by
sphinx-quickstart on Sun Oct 15 13:21:30 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Aoriil's documentation!
==================================

.. toctree::
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions backend/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
17 changes: 17 additions & 0 deletions backend/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
"""

import cv2
import src.core.imagetranslation as imagetranslation

image_path = "images/japanese9.png"
image = cv2.imread(image_path)

translated_image = imagetranslation.translate(
image, show_borders=True, save_image=True
)

cv2.imshow("Original image ", image)
cv2.imshow("Translated Image ", translated_image)
cv2.waitKey()
cv2.destroyAllWindows()
18 changes: 18 additions & 0 deletions backend/examples/image_conversion_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
"""

# TODO: The files in the ./examples/ directory currently doesn't run due to
# python's importing modules issue. We need to specify a better path so we
# can run examples and test it. Fix priorty is high
import cv2
from src.core.imagetranslation import translate

image_path = "images/japanese9.png"
image = cv2.imread(image_path)

translated_image = translate(image, show_borders=True, save_image=True)

cv2.imshow("Original image ", image)
cv2.imshow("Translated Image ", translated_image)
cv2.waitKey()
cv2.destroyAllWindows()
Loading

0 comments on commit 67d9427

Please sign in to comment.