-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from georgw777/develop
v1.0.0
- Loading branch information
Showing
100 changed files
with
8,416 additions
and
5,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: publish-docs | ||
|
||
env: | ||
GITHUB_ACTOR: georgw777 | ||
GITHUB_REPOSITORY: georgw777/chesscog | ||
GITHUB_TOKEN: ${{ secrets.CHESSCOG_PAT_TOKEN }} | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build_sphinx_job: | ||
runs-on: ubuntu-latest | ||
container: debian:buster-slim | ||
|
||
steps: | ||
- name: Get prerequisites and clone repository | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CHESSCOG_PAT_TOKEN }} | ||
run: | | ||
set -x | ||
apt-get update | ||
apt-get install -y git curl | ||
git clone -b master "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" . | ||
shell: bash | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1.1.1 | ||
with: | ||
virtualenvs-create: false | ||
- name: Install dependencies | ||
run: poetry install -E docs | ||
- name: Run build script for Sphinx pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CHESSCOG_PAT_TOKEN }} | ||
run: | | ||
cd docs | ||
./buildsite.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
"""Chess position inference using computer vision. | ||
""" | ||
|
||
import sys | ||
import logging | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.2.7" | ||
__version__ = "1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,29 @@ | ||
"""Utility functions to convert between Cartesian and homogenous coordinates. | ||
""" | ||
|
||
import numpy as np | ||
|
||
|
||
def to_homogenous_coordinates(coordinates: np.ndarray) -> np.ndarray: | ||
"""Convert Cartesian to homogenous coordinates. | ||
Args: | ||
coordinates (np.ndarray): the Cartesian coordinates (shape: [..., 2]) | ||
Returns: | ||
np.ndarray: the homogenous coordinates (shape: [..., 3]) | ||
""" | ||
return np.concatenate([coordinates, | ||
np.ones((*coordinates.shape[:-1], 1))], axis=-1) | ||
|
||
|
||
def from_homogenous_coordinates(coordinates: np.ndarray) -> np.ndarray: | ||
"""Convert homogenous to Cartesian coordinates. | ||
Args: | ||
coordinates (np.ndarray): the homogenous coordinates (shape: [..., 3]) | ||
Returns: | ||
np.ndarray: the Cartesian coordinates (shape: [..., 2]) | ||
""" | ||
return coordinates[..., :2] / coordinates[..., 2, np.newaxis] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
"""Module for handling datasets. | ||
""" | ||
|
||
from .dataset import color_name, piece_name, name_to_piece, build_transforms, build_dataset, build_data_loader | ||
from .transforms import unnormalize, build_transforms | ||
from .datasets import Datasets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
|
||
class Datasets(Enum): | ||
"""Enumeration of the dataset split. | ||
""" | ||
TRAIN = "train" | ||
VAL = "val" | ||
TEST = "test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.