glenn-jocher
commited on
Commit
•
987c226
1
Parent(s):
08e97a2
seaborn plotting correlogram addition
Browse files- requirements.txt +2 -1
- utils/general.py +13 -0
requirements.txt
CHANGED
@@ -23,4 +23,5 @@ tqdm>=4.41.0
|
|
23 |
# scikit-learn==0.19.2 # for coreml quantization
|
24 |
|
25 |
# extras --------------------------------------
|
26 |
-
# thop
|
|
|
|
23 |
# scikit-learn==0.19.2 # for coreml quantization
|
24 |
|
25 |
# extras --------------------------------------
|
26 |
+
# thop # FLOPS computation
|
27 |
+
# seaborn # plotting
|
utils/general.py
CHANGED
@@ -1188,6 +1188,19 @@ def plot_labels(labels, save_dir=''):
|
|
1188 |
plt.savefig(Path(save_dir) / 'labels.png', dpi=200)
|
1189 |
plt.close()
|
1190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1191 |
|
1192 |
def plot_evolution(yaml_file='data/hyp.finetune.yaml'): # from utils.general import *; plot_evolution()
|
1193 |
# Plot hyperparameter evolution results in evolve.txt
|
|
|
1188 |
plt.savefig(Path(save_dir) / 'labels.png', dpi=200)
|
1189 |
plt.close()
|
1190 |
|
1191 |
+
# seaborn correlogram
|
1192 |
+
try:
|
1193 |
+
import seaborn as sns
|
1194 |
+
import pandas as pd
|
1195 |
+
x = pd.DataFrame(b.transpose(), columns=['x', 'y', 'width', 'height'])
|
1196 |
+
sns.pairplot(x, corner=True, diag_kind='hist', kind='scatter', markers='o',
|
1197 |
+
plot_kws=dict(s=3, edgecolor=None, linewidth=1, alpha=0.02),
|
1198 |
+
diag_kws=dict(bins=50))
|
1199 |
+
plt.savefig(Path(save_dir) / 'labels_correlogram.png', dpi=200)
|
1200 |
+
plt.close()
|
1201 |
+
except Exception as e:
|
1202 |
+
pass
|
1203 |
+
|
1204 |
|
1205 |
def plot_evolution(yaml_file='data/hyp.finetune.yaml'): # from utils.general import *; plot_evolution()
|
1206 |
# Plot hyperparameter evolution results in evolve.txt
|