mirror of
https://github.com/Deepshift/DeepCreamPy.git
synced 2024-12-01 04:00:21 +00:00
add msg for common mistakes by beginners
This commit is contained in:
parent
21c4dc4d71
commit
82f0d883f4
49
decensor.py
49
decensor.py
@ -1,36 +1,33 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import numpy as np
|
# default library
|
||||||
from PIL import Image
|
import os, logging, sys, config
|
||||||
import tensorflow as tf
|
except ImportError as e:
|
||||||
|
print("Error when importing DEFAULT library : ", e)
|
||||||
import os, logging, sys
|
print("\nIf you made script named [\"os.py\", \"logging.py\", \"sys.py\", \"config.py\"] rename it")
|
||||||
from copy import deepcopy
|
print("If not, re-install python or check your Python environment variables")
|
||||||
|
try:
|
||||||
import config
|
# local library
|
||||||
import file
|
import file
|
||||||
from model import InpaintNN
|
from model import InpaintNN
|
||||||
from libs.utils import *
|
from libs.utils import *
|
||||||
# for QThread
|
# external library
|
||||||
from PySide2 import QtCore
|
import numpy as np
|
||||||
|
from PIL import Image
|
||||||
|
import tensorflow as tf
|
||||||
|
from PySide2 import QtCore # for QThread
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print("Error when importing libraries: ", e)
|
print("\n"+ '='*20 + " ImportError " + "=" * 20 + "\n")
|
||||||
print("Some Python libraries are missing. You can install all required libraries by running in the command line 'pip install -r requirements.txt' ")
|
if e.__class__.__name__ == "ModuleNotFoundError":
|
||||||
exit(1)
|
print(e)
|
||||||
|
print("Python libraries are missing. You can install all required libraries by running in the command line (terminal)")
|
||||||
|
print("cpu version : pip install -r requirements-cpu.txt")
|
||||||
|
print("gpu version : pip install -r requirements-gpu.txt")
|
||||||
|
else:
|
||||||
|
print("Error when importing libraries: ", e)
|
||||||
|
print("\nIf pip doesn't work, try update through Anaconda")
|
||||||
|
print("install Anaconda : https://www.anaconda.com/distribution/ \n")
|
||||||
|
|
||||||
# #signals to the ui to print out
|
|
||||||
# class EmittingStream(QtCore.QObject):
|
|
||||||
# textWritten = QtCore.pyqtSignal(str)
|
|
||||||
|
|
||||||
# def write(self, text):
|
|
||||||
# self.textWritten.emit(str(text))
|
|
||||||
'''
|
|
||||||
print text later on other label telling status, informations ,...
|
|
||||||
custom_print -> signals."methodname".emit( ... ) later
|
|
||||||
changing GUI on other thread(not MainWindow) is not allowed
|
|
||||||
'''
|
|
||||||
class Decensor(QtCore.QThread):
|
class Decensor(QtCore.QThread):
|
||||||
def __init__(self, text_edit = None, text_cursor = None, ui_mode = None):
|
def __init__(self, text_edit = None, text_cursor = None, ui_mode = None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
Loading…
Reference in New Issue
Block a user