我尝试按照此官方存储库安装 Facebook 的 Detectron2 。遵循该存储库,Detectron2 只能安装在 Linux 上。但是,我正在开发在 Windows 操作员上运行的服务器。有人知道如何在 Windows 上安装它吗?
python python-3.x deep-learning pytorch object-detection-api
我喜欢使用 Plotly 来可视化所有内容,我试图通过 Plotly 来可视化混淆矩阵,这是我的代码:
def plot_confusion_matrix(y_true, y_pred, class_names):
confusion_matrix = metrics.confusion_matrix(y_true, y_pred)
confusion_matrix = confusion_matrix.astype(int)
layout = {
"title": "Confusion Matrix",
"xaxis": {"title": "Predicted value"},
"yaxis": {"title": "Real value"}
}
fig = go.Figure(data=go.Heatmap(z=confusion_matrix,
x=class_names,
y=class_names,
hoverongaps=False),
layout=layout)
fig.show()
Run Code Online (Sandbox Code Playgroud)
结果是
python visualization machine-learning confusion-matrix plotly