原创 小項目——自制畫風數據集

承接上篇爬取了想要的數據集之後,先將圖片的尺寸統一。(我自己爬取了塗鴉,油畫,素描這3類圖片) 關於塗鴉數據集爬下來的圖片,其中混入了一些妹子和西海岸黑人黑幫文化的圖片。(爲什麼我也不知道。。。)注意清除,數據集的好壞很關鍵! r

原创 小項目——馬賽克風格遷移

最近一直想做一個質量較高的塗鴉作品,但迫於非科班出生加上控瓶能力有限無法處理好圖像細節,於是用python助力藝術,將原圖畫風遷移成馬賽克風格。9行代碼,內容不多也沒什麼好講解的,用過相關庫的同志們肯定懂,就當看看塗鴉作品吧:)

原创 小項目——圖轉

import numpy as np import math import cv2 img_name = '/home/thugliu/2.jpeg' img = cv2.imread(img_name) img = wrappe

原创 137. 只出現一次的數字 II

class Solution: def singleNumber(self, nums): """ :type nums: List[int] :rtype: int

原创 136. 只出現一次的數字

class Solution: def singleNumber(self, nums): """ :type nums: List[int] :rtype: int

原创 139. 單詞拆分

class Solution: def wordBreak(self, s, wordDict): """ :type s: str :type wordDict: List[

原创 130. 被圍繞的區域

class Solution: def solve(self, board): """ :type board: List[List[str]] :rtype: void Do

原创 134. 加油站

class Solution: def canCompleteCircuit(self, gas, cost): """ :type gas: List[int] :type

原创 131. 分割回文串

class Solution: def partition(self, s): """ :type s: str :rtype: List[List[str]]

原创 小項目--馬賽克風格遷移

最近一直想做一個質量較高的塗鴉作品,但迫於非科班出生加上控瓶能力有限無法處理好圖像細節,於是用python助力藝術,將原圖畫風遷移成馬賽克風格。9行代碼,內容不多也沒什麼好講解的,用過相關庫的同志們肯定懂,就當看看塗鴉作品吧:) im

原创 111. 二叉樹的最小深度

class Solution: def minDepth(self, root): """ :type root: TreeNode :rtype: int "

原创 118. 楊輝三角

class Solution: def generate(self, numRows): """ :type numRows: int :rtype: List[List[in

原创 112. 路徑總和

class Solution: def hasPathSum(self, root, sum): """ :type root: TreeNode :type sum: int

原创 122. 買賣股票的最佳時機 II

class Solution: def maxProfit(self, prices): """ :type prices: List[int] :rtype: int

原创 125. 驗證迴文串

class Solution: def isPalindrome(self, s): """ :type s: str :rtype: bool """