animal-gui.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. #
  5. # Copyright 2022 Stephen Stengel <stephen.stengel@cwu.edu> and friends
  6. #
  7. import gi
  8. gi.require_version("Gtk", "3.0")
  9. from gi.repository import Gtk
  10. def main(args):
  11. print("Hello! Loading...")
  12. #Splash screen should go here.
  13. #I can't find any working tutorials or documentation. Gtk.main()
  14. #makes the window show, BUT blocks execution until you close the splash window.
  15. # ~ splash = Gtk.Window(title="Hello World")
  16. # ~ splash.connect("destroy", Gtk.main_quit)
  17. # ~ splash.show_all()
  18. # ~ while Gtk.events_pending():
  19. # ~ Gtk.main_iteration()
  20. # ~ splash.show_all()
  21. # ~ splash.show()
  22. # ~ Gtk.main_iteration()
  23. #testing opening another window after doing some heavy imports.
  24. # ~ print("loading tensorflow...")
  25. # ~ import tensorflow as tf
  26. # ~ print("loading sklearn...")
  27. # ~ import sklearn
  28. # ~ print("loading skimage...")
  29. # ~ import skimage
  30. # ~ print("loading numpy...")
  31. # ~ import numpy as np
  32. # ~ print("loading keras.models...")
  33. # ~ from keras.models import Sequential
  34. # ~ print("loading inceptionv3...")
  35. # ~ from keras.applications.inception_v3 import InceptionV3
  36. # ~ print("loading keras layers...")
  37. # ~ from keras.layers import Input, Conv2D, MaxPooling2D, Flatten, Dense, Dropout
  38. # ~ print("loading keras loss...")
  39. # ~ from keras.losses import SparseCategoricalCrossentropy
  40. # ~ print("Loading tensorflow...")
  41. # ~ import tensorflow
  42. print("loading file window...")
  43. from FileSelectWindow import FileSelectWindow
  44. print("Done!")
  45. # ~ splash.destroy()
  46. theWindow2 = FileSelectWindow()
  47. Gtk.main()
  48. return 0
  49. if __name__ == '__main__':
  50. import sys
  51. sys.exit(main(sys.argv))