Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
maikherbig authored Jan 27, 2021
1 parent ca9b70a commit a5c2aca
Show file tree
Hide file tree
Showing 14 changed files with 829 additions and 0 deletions.
70 changes: 70 additions & 0 deletions PyBox/Pybox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
"""
pybox: This is a software bundle containing Python and lots of Python packages preinstalled
#######################Run this script to start the app########################
-> Serve your app to any PC or Mac.
---------
@author: maikherbig
"""
__version__ = "0.1.0" #version number of pybox

import os,sys,gc

import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtWidgets, QtGui
from pyqtgraph import Qt
import pybox_start

print("PyBox version: "+__version__)

#suppress warnings/info from tensorflow
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'

#determine the Operating system
if not sys.platform.startswith("win"):
from multiprocessing import freeze_support
freeze_support()
# Make sure to get the right icon file on win,linux and mac
if sys.platform=="darwin":
icon_suff = ".icns"
else:
icon_suff = ".ico"

##########################Optional: Splash-screen #############################
##################(Only use it if you also have a frontend)####################
try:
splashapp = QtWidgets.QApplication(sys.argv)
# Create and display the splash screen
splash = pybox_start.splashscreen(icon_suff)
except:
pass

########################Required: some script to execute#######################
pybox_start.pybox_start()#Could be a banner. Or, you could put your whole script into pybox_start and only exectute this

##############################Optional: GUI####################################
#import frontend #import frontend very late such that the splashscreen loads fast

dir_root = os.path.dirname(pybox_start.__file__)#ask the module for its origin
def main():
app,MainWindow = pybox_start.pybox_main(icon_suff)

try:
splash.finish(MainWindow)
except:
pass

ret = app.exec_()
sys.exit(ret)

if __name__ == '__main__':
try:
main()
except:
pass






73 changes: 73 additions & 0 deletions PyBox/all_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-
"""
aid_imports
list of each import
---------
@author: maikherbig
"""

import os,shutil,json,re,urllib
import numpy as np
import dclab
import h5py,time
import gc,tempfile
import pandas as pd
import tensorflow as tf
from tensorflow.python.tools import optimize_for_inference_lib
import keras
from keras.models import load_model,Model
from keras.layers import Dense,Activation
from keras import backend as K

import keras_metrics #side package for precision, recall etc during training
global keras_metrics

from keras2onnx import convert_keras
from onnx import save_model as save_onnx
from mmdnn.conversion._script import convertToIR,IRToCode,convert
import coremltools
import cv2
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtWidgets, QtGui
import sys,traceback,ast
from pyqtgraph.Qt import QtWidgets
from scipy import ndimage
from tensorflow.python.client import device_lib


import pyqtgraph as pg
from pyqtgraph import Qt

import pybox_start

import io,platform
import copy
from stat import S_IREAD,S_IRGRP,S_IROTH,S_IWRITE,S_IWGRP,S_IWOTH

from tensorboard import program
from tensorboard import default

from tensorflow.python.client import device_lib

from scipy import misc
from sklearn import metrics,preprocessing
import matplotlib.pyplot as plt
import PIL
import openpyxl,xlrd
import psutil

from keras.models import model_from_json,model_from_config,clone_model
from keras.preprocessing.image import load_img
from keras.utils import np_utils,multi_gpu_model
from keras.utils.conv_utils import convert_kernel
from keras2onnx import convert_keras
from onnx import save_model as save_onnx

import frontend

from keras.models import Sequential
from keras.layers import Add,Concatenate,Input,Dense,Dropout,Flatten,Activation,Conv2D,MaxPooling2D,BatchNormalization,GlobalAveragePooling2D,GlobalMaxPooling2D,concatenate
from keras.layers.merge import add
from keras import regularizers
from keras.engine.topology import get_source_inputs
import keras_applications
Binary file added PyBox/art/icon_main.icns
Binary file not shown.
Binary file added PyBox/art/icon_main.ico
Binary file not shown.
Binary file added PyBox/art/icon_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
141 changes: 141 additions & 0 deletions PyBox/art/icon_main.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PyBox/art/icon_splash.ico
Binary file not shown.
Binary file added PyBox/art/icon_splashe.icns
Binary file not shown.
31 changes: 31 additions & 0 deletions PyBox/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
"""
backend
---------
@author: maikherbig
"""
import os,shutil,json
import io,sys
import frontend
dir_root = os.path.dirname(frontend.__file__)#ask the module for its origin


def run_python(code):
codeOut = io.StringIO()
out,error = "",""
# capture output
sys.stdout = codeOut
try:
exec(code,globals())
except Exception as e:
error = str(e)
# restore stdout
sys.stdout = sys.__stdout__
out = codeOut.getvalue()
codeOut.close()

return out,error




Loading

0 comments on commit a5c2aca

Please sign in to comment.