中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

pc網(wǎng)站和app哪個容易做百度一下搜索

pc網(wǎng)站和app哪個容易做,百度一下搜索,wordpress鏈接b站,怎么創(chuàng)一個網(wǎng)站賺錢以下教程用于驗證轉(zhuǎn)成YOLO使用的txt格式,適用場景:矩形框,配合json格式文件轉(zhuǎn)成YOLO使用的txt格式腳本使用。 https://blog.csdn.net/StopAndGoyyy/article/details/138681454 使用方式:將img_path和label_path分別填入對應的圖…

?以下教程用于驗證轉(zhuǎn)成YOLO使用的txt格式,適用場景:矩形框,配合json格式文件轉(zhuǎn)成YOLO使用的txt格式腳本使用。

https://blog.csdn.net/StopAndGoyyy/article/details/138681454

使用方式:將img_path和label_path分別填入對應的圖片(文件夾)及標簽(文件夾)路徑,運行。show_num參數(shù)控制最大展示數(shù)量,按空格切換。

import os
import numpy as np
import cv2img_format = ['.jpg', '.png', '.jpeg']
colors = [(0, 0, 0), (128, 0, 0), (0, 128, 0), (128, 128, 0), (0, 0, 128), (128, 0, 128), (0, 128, 128),(128, 128, 128), (64, 0, 0), (192, 0, 0), (64, 128, 0), (192, 128, 0), (64, 0, 128), (192, 0, 128),(64, 128, 128), (192, 128, 128), (0, 64, 0), (128, 64, 0), (0, 192, 0), (128, 192, 0), (0, 64, 128),(128, 64, 12)]def get_files(img_path, label_path):img_list = []label_list = []datast_img_format = Noneassert os.path.exists(img_path) and os.path.exists(label_path), print("??文件夾不存在??")if os.path.isdir(img_path):for i in os.listdir(img_path):if os.path.splitext(i)[-1] in img_format:# i = i.replace(os.path.splitext(i)[-1], '')img_list.append(i)datast_img_format=img_list[-1].split('.')[-1]if os.path.isdir(label_path):for i in os.listdir(label_path):if os.path.splitext(i)[-1] == '.txt':i = i.replace(os.path.splitext(i)[-1], '')label_list.append(i)print("路徑下無jpg,png,jpeg格式的圖片,當前圖像路徑:" + str(img_path) if len(img_list) == 0 else "圖像總數(shù)為:" + str(len(img_list)))print("路徑下無標簽文件,當前標簽路徑" + str(label_path) if len(label_list) == 0 else "標簽總數(shù)為:" + str(len(label_list)))img_without_label = []for i in img_list:if i.replace(os.path.splitext(i)[-1], '') not in label_list:img_without_label.append(i)if len(img_without_label) != 0:print("標簽丟失的圖像有:" + str(img_without_label))ok_img = list(set(img_list) - set(img_without_label))return [i.replace('.jpg', '') for i in ok_img], '.'+datast_img_format# 坐標轉(zhuǎn)換
def xywh2xyxy(x, w1, h1, img):label, x, y, w, h = xx_t = x * w1y_t = y * h1w_t = w * w1h_t = h * h1top_left_x = x_t - w_t / 2top_left_y = y_t - h_t / 2bottom_right_x = x_t + w_t / 2bottom_right_y = y_t + h_t / 2cv2.rectangle(img, (int(top_left_x), int(top_left_y)), (int(bottom_right_x), int(bottom_right_y)),colors[int(label)] if int(label) < len(colors) else colors[0], 2)cv2.putText(img, text=str(int(label)), org=(int(top_left_x), int(top_left_y)), fontFace=cv2.FONT_HERSHEY_COMPLEX,fontScale=1, color=colors[int(label)] if int(label) < len(colors) else colors[0], thickness=3)return imgif __name__ == '__main__':# 修改輸入圖片文件夾img_path = r"O:\DeepLearningTool\01_handle_dataset\dataset\object\image"# img_path = r"O:\DeepLearningTool\dataset\image"# 修改輸入標簽文件夾label_path = r"O:\DeepLearningTool\01_handle_dataset\dataset\object\label"# label_path = r"O:\DeepLearningTool\dataset\label"# 輸出文件夾outfile = './'# 是否展示繪制的圖片if_show = True# 最大展示圖片的數(shù)量(按空格切換)show_num = 3# 是否保存繪制的圖片if_save = Falseif os.path.isdir(img_path):ok_img, datast_img_format = get_files(img_path, label_path)haveShow = 0for i in ok_img:assert os.path.exists(str(img_path) + '\\' + i + datast_img_format)img = cv2.imread(str(img_path) + '\\' + i + datast_img_format)h, w = img.shape[:2]with open(label_path + '\\' + i + '.txt', 'r') as f:lb = np.array([x.split() for x in f.read().strip().splitlines()], dtype=np.float32)for x in lb:img = xywh2xyxy(x, w, h, img)if if_show:cv2.namedWindow('Image with label', 0)cv2.resizeWindow('Image with label', 600, 500)cv2.imshow('Image with label', img)cv2.waitKey(0)if if_save:outfile = outfile if len(outfile) > 0 else './output/'if not os.path.exists('./output/'):os.mkdir('./output/')print(outfile + i)cv2.imwrite(outfile+i+datast_img_format, img)haveShow += 1if haveShow == show_num:breakelse:img = cv2.imread(str(img_path))h, w = img.shape[:2]assert os.path.isfile(label_path), '標簽路徑錯誤'with open(label_path) as f:lb = np.array([x.split() for x in f.read().strip().splitlines()], dtype=np.float32)for x in lb:img = xywh2xyxy(x, w, h, img)if if_show:cv2.namedWindow('Image with label', 0)cv2.resizeWindow('Image with label', 600, 500)cv2.imshow('Image with label', img)cv2.waitKey(0)

http://www.risenshineclean.com/news/58193.html

相關文章:

  • 國家企業(yè)信息系統(tǒng)官方seo優(yōu)化多久能上排名
  • 用eclipse編程做網(wǎng)站自動app優(yōu)化最新版
  • 網(wǎng)站開發(fā)計劃書范文怎么創(chuàng)建一個網(wǎng)址
  • 保定定興網(wǎng)站建設安卓手機優(yōu)化神器
  • 如何查找做網(wǎng)站的服務商白山網(wǎng)絡推廣
  • 做網(wǎng)站跟app的區(qū)別營銷策劃公司排行榜
  • 自己做的網(wǎng)站怎么設置文件下載國外免費網(wǎng)站服務器
  • 怎樣做企業(yè)手機網(wǎng)站seo二級目錄
  • 網(wǎng)站點擊量怎么看關鍵詞排名批量查詢
  • 云客服系統(tǒng)合肥百度搜索優(yōu)化
  • 6黃頁網(wǎng)站建設網(wǎng)絡推廣公司主要做什么
  • 站點建錯了網(wǎng)頁能打開嗎seo還有用嗎
  • 網(wǎng)站html地圖怎么做百度廣告競價
  • 全椒做網(wǎng)站seo專業(yè)培訓
  • 網(wǎng)站建設內(nèi)容和功能的介紹做百度推廣銷售怎么找客戶
  • 中山比好的做網(wǎng)站的公司企業(yè)官網(wǎng)
  • 自己買主機可以做網(wǎng)站嗎濟南seo小黑seo
  • 建設網(wǎng)站公司價格2024年將爆發(fā)新瘟疫
  • 做網(wǎng)站的榮譽證書推廣運營公司哪家好
  • 專門做詳情頁的網(wǎng)站google海外版
  • 男女做那種的視頻網(wǎng)站百度平臺客服聯(lián)系方式
  • 馬鞍山建設機械網(wǎng)站seo優(yōu)化網(wǎng)站的注意事項
  • 手機免費制作ppt的軟件下載谷歌seo一個月費用需要2萬嗎
  • 佳木斯城鄉(xiāng)建設局官方網(wǎng)站seo排名專業(yè)公司
  • wordpress建站專家網(wǎng)絡營銷需要學什么
  • 建設網(wǎng)站的策劃書最強大的搜索引擎
  • 網(wǎng)站設計的原則有哪些互聯(lián)網(wǎng)營銷的方法
  • 軟件和網(wǎng)站開發(fā)seo專家是什么意思
  • 做網(wǎng)站ie緩存重慶seo團隊
  • 工廠做網(wǎng)站有用嗎廊坊seo外包