Skip to content

Commit

Permalink
Merge branch 'master' into release-please--branches--master--componen…
Browse files Browse the repository at this point in the history
…ts--release-please-action
  • Loading branch information
Kohulan authored Jun 11, 2024
2 parents 6d00055 + d990c6f commit 3280f0e
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 71 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.py text=auto eol=lf
*.bat eol=crlf
58 changes: 29 additions & 29 deletions DECIMER/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# -*- coding: utf-8 -*-
"""DECIMER V2.6.0 Python Package. ============================
This repository contains DECIMER-V2,Deep lEarning for Chemical ImagE Recognition) project
was launched to address the OCSR problem with the latest computational intelligence methods
to provide an automated open-source software solution.
Typical usage example:
from decimer import predict_SMILES
# Chemical depiction to SMILES translation
image_path = "path/to/imagefile"
SMILES = predict_SMILES(image_path)
print(SMILES)
For comments, bug reports or feature ideas,
please raise a issue on the Github repository.
"""

__version__ = "2.6.0"

__all__ = [
"DECIMER",
]


from .decimer import predict_SMILES
# -*- coding: utf-8 -*-
"""DECIMER V2.6.0 Python Package. ============================
This repository contains DECIMER-V2,Deep lEarning for Chemical ImagE Recognition) project
was launched to address the OCSR problem with the latest computational intelligence methods
to provide an automated open-source software solution.
Typical usage example:
from decimer import predict_SMILES
# Chemical depiction to SMILES translation
image_path = "path/to/imagefile"
SMILES = predict_SMILES(image_path)
print(SMILES)
For comments, bug reports or feature ideas,
please raise a issue on the Github repository.
"""

__version__ = "2.6.0"

__all__ = [
"DECIMER",
]


from .decimer import predict_SMILES
2 changes: 1 addition & 1 deletion DECIMER/decimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def detokenize_output_add_confidence(
decoded_prediction_with_confidence = list(
[(utils.decoder(tok), conf) for tok, conf in prediction_with_confidence_]
)
decoded_prediction_with_confidence.append(prediction_with_confidence_[-1])

return decoded_prediction_with_confidence


Expand Down
9 changes: 4 additions & 5 deletions DECIMER/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ def ensure_models(default_path: str, model_urls: dict) -> dict:
}
for model_name, model_url in model_urls.items():
model_path = os.path.join(default_path, f"{model_name}_model")
if (
os.path.exists(model_path)
and os.stat(os.path.join(model_path, "saved_model.pb")).st_size != model_sizes.get(model_name)
):
print(f'Working with model {model_name}')
if os.path.exists(model_path) and os.stat(
os.path.join(model_path, "saved_model.pb")
).st_size != model_sizes.get(model_name):
print(f"Working with model {model_name}")
shutil.rmtree(model_path)
config.download_trained_weights(model_url, default_path)
elif not os.path.exists(model_path):
Expand Down
70 changes: 35 additions & 35 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,35 +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
@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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
author_email="kohulan.rajan@uni-jena.de",
maintainer="Kohulan Rajan, Otto Brinkhaus ",
maintainer_email="kohulan.rajan@uni-jena.de, otto.brinkhaus@uni-jena.de",
description="DECIMER 2.6.0: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer",
description="DECIMER 2.7.0: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer",
long_description=long_description,
long_description_content_type="text/markdown",
entry_points={
Expand Down

0 comments on commit 3280f0e

Please sign in to comment.