Skip to content

Commit

Permalink
add liscence to add files
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclifford1 committed Jul 1, 2024
1 parent 0443576 commit 63d9963
Show file tree
Hide file tree
Showing 42 changed files with 103 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-package-to-PyPi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Deploy package to PyPi when a new VERSION is release to the main branch
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License


name: Upload Python Package to PyPi

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# N.B. currently doesn't build the docs: need to do that locally with
# ./scrips/make_docs.sh
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License


name: Publish Documentation to Github Pages

Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/UI/custom_widgets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
''' Custom SubClasses of PyQt6 widget to extent to the required functionality '''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from PyQt6.QtCore import pyqtSignal
from PyQt6.QtWidgets import QProgressBar, QLabel

Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/UI/experiment_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
create experiment window
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import random
import threading
Expand Down
1 change: 1 addition & 0 deletions IQM_Vis/UI/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
UI image functions
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import imghdr
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/UI/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
UI create layout
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import warnings
from PyQt6.QtWidgets import (QMainWindow,
Expand Down
1 change: 1 addition & 0 deletions IQM_Vis/UI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
main entry point to initialise the UI
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import time
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/UI/style-dark.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* Author: Matt Clifford <[email protected]>
License: BSD 3-Clause License */

QWidget {
background-color: "black";
color: "white";
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/UI/style-light.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* Author: Matt Clifford <[email protected]>
License: BSD 3-Clause License */

QWidget {
background-color: "white";
color: "black";
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/UI/threads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
''' thread and signal classes to makethe UI smoother
useful info about PyQt6 threads: https://www.pythontutorial.net/pyqt/pyqt-qthread/'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from PyQt6.QtCore import QObject, pyqtSignal, pyqtSlot
from IQM_Vis.utils import plot_utils

Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/UI/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from PyQt6.QtWidgets import QWidget


Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/UI/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
UI create widgets
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import re
from functools import partial

Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from IQM_Vis.ui_wrapper import make_UI
from IQM_Vis.data_handlers.data_api import dataset_holder
from IQM_Vis.transformations import transforms
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/data_handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from IQM_Vis.data_handlers.data_api_abstract import base_dataloader, base_dataset_loader
2 changes: 2 additions & 0 deletions IQM_Vis/data_handlers/data_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
both use the same image for reference and transformed
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import imghdr
from functools import cache
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/data_handlers/data_api_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
blueprint for data loader API
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from abc import ABC, abstractmethod

class base_dataloader(ABC):
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/all.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
''' run all avaiable metrics/ transforms '''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import IQM_Vis

def run():
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import numpy as np
import IQM_Vis
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/dists.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import glob
import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/experiment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import numpy as np
import IQM_Vis
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/kodak.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
''' KODAK dataset '''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import glob
import IQM_Vis
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/multiple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import numpy as np
import IQM_Vis
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/new_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
''' KODAK dataset '''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import glob
import IQM_Vis
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/examples/simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import numpy as np
import IQM_Vis
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/metrics/IQMs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
sample metrics to use with the examples of the UI
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import torch
import torch.nn as nn
import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/metrics/NLPD_torch/utils/interp1d.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# code dep from https://github.com/aliutkus/torchinterp1d/blob/master/torchinterp1d/interp1d.py
# Author: Antoine Liutkus
# License: BSD 3-Clause License

import torch
import contextlib

Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/metrics/SSIM/ssim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# taken from https://github.com/VainF/pytorch-msssim/blob/master/pytorch_msssim/ssim.py
# Copyright 2020 by Gongfan Fang, Zhejiang University.
# All rights reserved.
# Author: Gongfan Fang
# Licence: MIT

import warnings
from typing import List, Optional, Tuple, Union

Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/transformations/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Sample image transformations to get the user started with
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from skimage.transform import resize, rotate
from skimage.util import img_as_ubyte
import cv2
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/ui_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
TODO: write docs on example usage/ what inputs etc. and what attributes that the data_store class needs
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import subprocess
import platform
import sys
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from IQM_Vis.utils.image_utils import *
from IQM_Vis.utils.plot_utils import bar_plotter, radar_plotter, compute_metrics_over_range_single_trans, get_radar_plots_avg_plots, get_transform_range_plots
from IQM_Vis.utils.save_utils import *
2 changes: 2 additions & 0 deletions IQM_Vis/utils/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Utils for PyQt6 image, text and graph widgets
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

try:
from PyQt6.QtGui import QPixmap, QImage
import matplotlib; matplotlib.use('Qt5Agg')
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/utils/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
image helper functions
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import PIL
import cv2
Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/utils/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
TODO: write docs how to use these (currently just have to look at the UI code)
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from functools import partial
import math

Expand Down
2 changes: 2 additions & 0 deletions IQM_Vis/utils/save_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
utils for saving experiments, images and figures
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import json
import pickle
Expand Down
3 changes: 3 additions & 0 deletions IQM_Vis/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

# Changing the version number will action GitHub to push to PyPi the new version
__version__ = '0.2.5.87'
3 changes: 3 additions & 0 deletions scripts/create_conda_dev_env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/bash
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License


VENV=IQM_Vis
CONDA_BASE=$(conda info --base)
Expand Down
3 changes: 2 additions & 1 deletion scripts/get_latest_pypi_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/python3

'''Get the latest version of a PyPi package'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import urllib.request
import sys
import json
Expand Down
3 changes: 2 additions & 1 deletion scripts/get_local_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/python3

'''Get the current version of package locally (github repo) - N.B. needs to be run from root of repo'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import os
import sys

Expand Down
3 changes: 3 additions & 0 deletions scripts/make_docs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/bash
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License


rm docs/IQM_Vis.*
# sphinx-build -o docs IQM_Vis
Expand Down
3 changes: 3 additions & 0 deletions scripts/push_to_pypi.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/bash
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License


git clean -xfd
python setup.py sdist bdist_wheel
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

from setuptools import setup, find_packages
import os

Expand Down
4 changes: 3 additions & 1 deletion tests/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
test invalid input to api throws an error
'''
# Author: Matt Clifford <[email protected]>
# License: BSD 3-Clause License

import pytest
import numpy as np

Expand Down Expand Up @@ -38,4 +40,4 @@ def test_warn_empty():
ui._check_inputs()

if __name__ == '__main__':
test_inputs()
test_not_dict()

0 comments on commit 63d9963

Please sign in to comment.