forked from WZMIAOMIAO/deep-learning-for-image-processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wz
authored and
wz
committed
Jun 6, 2020
1 parent
67bb0b7
commit 350f7bc
Showing
12 changed files
with
431 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,11 @@ __pycache__ | |
flower_data | ||
*.h5 | ||
*.pth | ||
*.pt | ||
*.jpg | ||
*.ckpt.* | ||
*.ckpt | ||
*.config | ||
checkpoint | ||
data | ||
VOCdevkit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 代码完善中,敬请期待... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import matplotlib.pyplot as plt | ||
|
||
|
||
def plot_loss_and_lr(train_loss, learning_rate): | ||
try: | ||
x = list(range(len(train_loss))) | ||
fig, ax1 = plt.subplots(1, 1) | ||
ax1.plot(x, train_loss, 'r', label='loss') | ||
ax1.set_xlabel("step") | ||
ax1.set_ylabel("loss") | ||
ax1.set_title("Train Loss and lr") | ||
plt.legend(loc='best') | ||
|
||
ax2 = ax1.twinx() | ||
ax2.plot(x, learning_rate, label='lr') | ||
ax2.set_ylabel("learning rate") | ||
ax2.set_xlim(0, len(train_loss)) # 设置横坐标整数间隔 | ||
plt.legend(loc='best') | ||
|
||
handles1, labels1 = ax1.get_legend_handles_labels() | ||
handles2, labels2 = ax2.get_legend_handles_labels() | ||
plt.legend(handles1 + handles2, labels1 + labels2, loc='upper right') | ||
|
||
fig.subplots_adjust(right=0.8) # 防止出现保存图片显示不全的情况 | ||
fig.savefig('./loss_and_lr.png') | ||
print("successful save loss curve! ") | ||
except Exception as e: | ||
print(e) | ||
|
||
|
||
def plot_map(mAP): | ||
try: | ||
x = list(range(len(mAP))) | ||
plt.plot(x, mAP, label='mAp') | ||
plt.xlabel('epoch') | ||
plt.ylabel('mAP') | ||
plt.title('Eval mAP') | ||
plt.xlim(0, len(mAP)) | ||
plt.legend(loc='best') | ||
plt.savefig('./mAP.png') | ||
print("successful save mAP curve!") | ||
except Exception as e: | ||
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.