Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta b #174

Merged
merged 8 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5,109 changes: 2,863 additions & 2,246 deletions BETA_E_Model_T&T.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Create_requirements.cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@echo off
echo Generating requirements.txt...
del requirements.txt >nul 2>&1
echo Y | pigar -l ERROR generate
echo (Batch script) Generating requirements.txt...
del requirements.txt >nul 2>&1
echo Y | pigar -l ERROR generate >nul 2>&1

rem Use PowerShell to remove the first line of requirements.txt and save to a temporary file
powershell -Command "Get-Content requirements.txt | Select-Object -Skip 2 | Set-Content requirements_temp.txt"

rem Replace the original file with the modified temporary file
move /Y requirements_temp.txt requirements.txt >nul
echo (Batch script) Done Generating requirements.txt.
Binary file modified Data/image_SUB_generator.pkl
Binary file not shown.
2 changes: 1 addition & 1 deletion Interface/CLI/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Aydin hamedi
Copyright (c) 2024 Aydin hamedi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Interface/GUI/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Aydin hamedi
Copyright (c) 2024 Aydin hamedi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Aydin hamedi
Copyright (c) 2024 Aydin hamedi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6,245 changes: 2,460 additions & 3,785 deletions Model_T&T.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Update_Code.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
del "Model_T&T.ipynb"
copy "BETA_E_Model_T&T.ipynb" "Model_T&T.ipynb"
del "Model_T&T.ipynb" >nul 2>&1
copy "BETA_E_Model_T&T.ipynb" "Model_T&T.ipynb" >nul 2>&1
46 changes: 46 additions & 0 deletions Utils/Debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#pylibs
import inspect
import traceback
from datetime import datetime
from Utils.print_color_V2_NEW import print_Color_V2
from Utils.print_color_V1_OLD import print_Color
#Debug
def P_Debug(ID, DEBUG_IF, SFL: bool = True, Force: bool = False, SFCS: bool = True):
"""
This function is used for debugging purposes. It prints out various information about the data passed to it.

Args:
ID (Any): The identifier for the data. This could be any type, but is typically a string.
DEBUG_IF (Any): The data that needs to be debugged. This could be any type.
SFL (bool, optional): A flag to determine if the stack frame location should be included in the debug information. Defaults to True.
SFCS (bool, optional): A flag to determine if the function call stack should be included in the debug information. Defaults to True.

Returns:
None
"""
try:
frame_info = inspect.currentframe()
stack_trace = traceback.format_stack()
stack_trace_formated = ''
for line in stack_trace[:-1]:
stack_trace_formated += '--> [!>>>' + line
location = f'{inspect.stack()[1].filename}:{frame_info.f_back.f_lineno}' if SFL else f'L:{frame_info.f_back.f_lineno}'
Debug_data = \
f'\n~*--> ~*DEBUG INFO id: ~*[{str(ID)}]~*, ' \
f'Location: ~*[{location}]~*, ' \
f'time: ~*[{datetime.now().strftime("%Y/%m/%d | %H:%M:%S")}]\n~*--> ~*' \
f'Data: ~*{str(DEBUG_IF)}\n~*--> ~*' \
f'Data Type: ~*{type(DEBUG_IF)}\n~*--> ~*' \
f'Memory Address: ~*DEC>>>~*{id(DEBUG_IF)}~* | HEX>>>~*{hex(id(DEBUG_IF))}~* | BIN>>>~*{bin(id(DEBUG_IF))}\n'
if SFCS:
Debug_data += f'~*--> ~*Function Call Stack: ~*↓\n~*{stack_trace_formated}\n'
print_Color(Debug_data,
['red', 'magenta', 'green', 'magenta', 'yellow', 'magenta', 'yellow',
'red', 'magenta', 'yellow', 'red', 'magenta', 'yellow', 'red', 'magenta',
'cyan', 'yellow', 'cyan', 'yellow', 'cyan', 'yellow', 'red', 'magenta', 'green', 'yellow'] if SFCS else \
['red', 'magenta', 'green', 'magenta', 'yellow', 'magenta', 'yellow',
'red', 'magenta', 'yellow', 'red', 'magenta', 'yellow', 'red', 'magenta',
'cyan', 'yellow', 'cyan', 'yellow', 'cyan', 'yellow'],
advanced_mode=True)
except Exception as err:
print_Color(f'~*[`Debug` func] --> ERROR: ~*{err}', ['red', 'yellow'], advanced_mode=True)
8 changes: 8 additions & 0 deletions Utils/Other.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ def P_warning(msg):
"""
print_Color_V2(f'<light_red>Warning: <yellow>{msg} (⚠️)')

def P_verbose(msg):
"""Prints a verbose message to the console.

Args:
msg (str): The verbose message to print.
"""
print_Color_V2(f'<light_cyan>Verbose: <normal>{msg}')

def evaluate_model_full(y_test, model_pred, model=None, x_test=None):
"""Evaluates a machine learning model on a test set.

Expand Down
5 changes: 4 additions & 1 deletion Utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
- ### github repo used(Python-color-print): [Python-color-print](https://github.com/Aydinhamedi/Python-color-print)
- ### doc link: [3_README.md](docs/3_README.md)

## P_Debug (by Me)
- ### github repo used: [Python-Debug-print](https://github.com/Aydinhamedi/Python-Debug-print)

## Grad_cam (by GPT-4 😁)

## Other.py (by Me)

## FixedDropout.py (by Me)
For EfficientNet model. Example:
For EfficientNet model Example:
```python
from Utils.FixedDropout import FixedDropout
from keras.models import load_model
Expand Down
Loading