Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- metrics_df = pd.read_json(
- "/kaggle/working/metrics (6).json", orient="records", lines=True)
- mdf = metrics_df.sort_values("iteration")
- print(mdf.tail(10).T)
- # Plot loss
- fig, ax = plt.subplots()
- mdf1 = mdf[~mdf["total_loss"].isna()]
- ax.plot(mdf1["iteration"], mdf1["total_loss"], c="C0", label="train")
- if "validation_loss" in mdf.columns:
- mdf2 = mdf[~mdf["validation_loss"].isna()]
- ax.plot(mdf2["iteration"], mdf2["validation_loss"],
- c="C1", label="validation")
- ax.legend()
- ax.set_title("Loss curve")
- plt.show()
- # Plot Accuracy stage 0 fastrcnn
- fig, ax = plt.subplots()
- mdf1 = mdf[~mdf["mask_rcnn/accuracy"].isna()]
- ax.plot(mdf1["iteration"], mdf1["mask_rcnn/accuracy"],
- c="C0", label="train")
- ax.legend()
- ax.set_title("MASKRCNN Accuracy curve")
- plt.show()
- # Plot Accuracy maskrcnn
- fig, ax = plt.subplots()
- mdf1 = mdf[~mdf["stage0/fast_rcnn/cls_accuracy"].isna()]
- ax.plot(mdf1["iteration"], mdf1["stage0/fast_rcnn/cls_accuracy"],
- c="C0", label="train")
- ax.legend()
- ax.set_title("FASTRCNN CLS Accuracy curve")
- plt.show()
- # Plot Bounding Box regressor loss
- fig, ax = plt.subplots()
- mdf1 = mdf[~mdf["loss_box_reg_stage0"].isna()]
- ax.plot(mdf1["iteration"], mdf1["loss_box_reg_stage0"], c="C0", label="train")
- ax.legend()
- ax.set_title("loss_box_reg")
- plt.show()
- # Plot loss cls stage0
- fig, ax = plt.subplots()
- mdf1 = mdf[~mdf["loss_cls_stage0"].isna()]
- ax.plot(mdf1["iteration"], mdf1["loss_cls_stage0"], c="C0", label="train")
- ax.legend()
- ax.set_title("loss_cls_stage0 ")
- plt.show()
- # Plot loss mask
- fig, ax = plt.subplots()
- mdf1 = mdf[~mdf["loss_mask"].isna()]
- ax.plot(mdf1["iteration"], mdf1["loss_mask"], c="C0", label="train")
- ax.legend()
- ax.set_title("loss mask")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement