原创 OpenCV生成相機標定板

1.代碼實現 #include <opencv.hpp> #include "highgui.h" #include "cxcore.h" using namespace cv; int main0(int argc, cha

原创 什麼是消融實驗(Ablation experiment)?

什麼是消融實驗(Ablation experiment)? 筆者第一次見到消融實驗(Ablation experiment)這個概念是在論文《Faster R-CNN》中。 消融實驗類似於“控制變量法”。 假設在某目標檢測系統中,

原创 Pycharm提示自定義的module導入錯誤

問題描述 在Pycharm中,我們會在同一個文件夾中存放多個項目,這會導致一個問題:在進行某個項目,當導入自己定義的module時,下方會出現紅色的波浪線,運行該項目,會提示“No module named xxx”,如下圖所示

原创 tf.nn.conv2d

1.簡介 tf.nn.conv2d函數是用於計算2-D卷積的函數,本文章對於該函數的解讀基於r1.15版本。(本文是針對英文API純手工翻譯,並加上自己的部分理解) 官網API地址傳送門:https://tensorflow.go

原创 DataFrame根據值篩選特定行

在DataFrame中,使用df.isin()函數可以在某一列中篩選出具有某一個或某幾個特定值的行 1.df定義 df = DataFrame() 2.函數調用方法 篩選包含1的行 df_data_1 = df[df['col

原创 如何獲取DataFrame的行數和列數

1.獲得行數 df.shape[0] 或者 len(df) 2.獲得列數 df.shape[1]

原创 DataFrame使用pd.sample()隨機選取N行數據

1.簡介 在訓練深度學習或者機器學習模型時,免不了需要按照比例劃分訓練集和驗證集,有的時候使用pandas的方式讀取csv數據文件,得到的是一個DataFrame的對象df,這時可以使用pd.sample()來實現從df中隨機抽樣

原创 Markdown繪製表格

1.方式一 姓名 | 年齡 | 數量分數 - | - | - 小明 | 18 | 96 小紅 | 20| 90 小王 | 19 | 85 呈現效果如下表所示: 姓名 年齡 數量分數 小明 18 96 小紅 20

原创 Problem#136 Single Number

Problem Solution class Solution: def singleNumber(self, nums: List[int]) -> int: single_num = 0

原创 Problem#121 Best Time to Buy and Sell Stock

Problem Solution class Solution: def maxProfit(self, prices: List[int]) -> int: min_price = float('inf

原创 Problem#125 Valid Palindrome

Problem Solution class Solution: def isPalindrome(self, s: str) -> bool: left, right = 0, len(s) - 1

原创 Problem#88 Merge Sorted Array

Problem Solution # 從後向前填充 class Solution: def merge(self, nums1: List[int], m: int, nums2: List[int], n: int)

原创 Problem#104 Maximum Depth of Binary Tree

Problem Solution # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # sel

原创 Problem#20 Valid Parentheses

Problem Solution class Solution: def isValid(self, s: str) -> bool: stack = [] map = {

原创 Problem#26 Remove Duplicates from Sorted Array

Problem Solution class Solution: def removeDuplicates(self, nums: List[int]) -> int: if nums: