Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions torchbenchmark/models/doctr_det_predictor/install.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import subprocess
import warnings
import json

from utils.python_utils import pip_install_requirements


def pip_install_requirements_doctr():
required_pkgs = ["expecttest", "libglib", "pango"]
try:
subprocess.check_call(
[
"conda",
"install",
"-y",
"expecttest",
"libglib",
"pango",
"-c",
"conda-forge",
]
)
installed_pkgs = [x["name"] for x in json.loads(subprocess.check_output(["conda", "list", "--json"], text=True))]
if not all(pkg in installed_pkgs for pkg in required_pkgs):
subprocess.check_call(
[
"conda",
"install",
"-y",
*required_pkgs,
"-c",
"conda-forge",
]
)
except:
warnings.warn(
"The doctr_det_predictor model requires conda binary libaries to be installed. Missing conda packages might break this model."
Expand Down
26 changes: 14 additions & 12 deletions torchbenchmark/models/doctr_reco_predictor/install.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import subprocess
import warnings
import json

from utils.python_utils import pip_install_requirements


def pip_install_requirements_doctr():
required_pkgs = ["expecttest", "libglib", "pango"]
try:
subprocess.check_call(
[
"conda",
"install",
"-y",
"expecttest",
"libglib",
"pango",
"-c",
"conda-forge",
]
)
installed_pkgs = [x["name"] for x in json.loads(subprocess.check_output(["conda", "list", "--json"], text=True))]
if not all(pkg in installed_pkgs for pkg in required_pkgs):
subprocess.check_call(
[
"conda",
"install",
"-y",
*required_pkgs,
"-c",
"conda-forge",
]
)
except:
warnings.warn(
"The doctr_reco_predictor model requires conda binary libaries to be installed. Missing conda packages might break this model."
Expand Down