Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/udayraj123/OMRChecker into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Udayraj123 committed Oct 2, 2024
2 parents e6b4d9f + c1b286b commit 93e7496
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: "**"
pull_request:
branches: "**"

env:
OMR_CHECKER_CONTAINER: true

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.dev.txt
pip install pre-commit
- name: Run pre-commit
run: |
pre-commit run
12 changes: 8 additions & 4 deletions src/utils/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

import cv2
from matplotlib import pyplot
from screeninfo import get_monitors

from screeninfo import Monitor, get_monitors
import os
from src.utils.constants import WAIT_KEYS
from src.utils.drawing import DrawingUtils
from src.utils.image import ImageUtils
from src.utils.logger import logger

monitor_window = get_monitors()[0]


@dataclass
class ImageMetrics:
# TODO: fix window metrics doesn't account for the doc/taskbar on macos
if os.environ.get("OMR_CHECKER_CONTAINER"):
monitor_window = Monitor(0, 0, 1000, 1000, 100, 100, "FakeMonitor", False)
else:
monitor_window = get_monitors()[0]
window_width, window_height = monitor_window.width, monitor_window.height
# for positioning image windows
window_x, window_y = 0, 0
Expand Down Expand Up @@ -113,6 +115,8 @@ def show(
config=None,
):
image_metrics = InteractionUtils.image_metrics
if os.environ.get("OMR_CHECKER_CONTAINER"):
return
if image is None:
logger.warning(f"'{name}' - NoneType image to show!")
if pause:
Expand Down

0 comments on commit 93e7496

Please sign in to comment.