HOME 首頁(yè)
SERVICE 服務(wù)產(chǎn)品
XINMEITI 新媒體代運(yùn)營(yíng)
CASE 服務(wù)案例
NEWS 熱點(diǎn)資訊
ABOUT 關(guān)于我們
CONTACT 聯(lián)系我們
創(chuàng)意嶺
讓品牌有溫度、有情感
專注品牌策劃15年

    如何收集圖片數(shù)據(jù)集(收集圖片的)

    發(fā)布時(shí)間:2023-04-08 02:13:02     稿源: 創(chuàng)意嶺    閱讀: 53        

    大家好!今天讓創(chuàng)意嶺的小編來(lái)大家介紹下關(guān)于如何收集圖片數(shù)據(jù)集的問(wèn)題,以下是小編對(duì)此問(wèn)題的歸納整理,讓我們一起來(lái)看看吧。

    開(kāi)始之前先推薦一個(gè)非常厲害的Ai人工智能工具,一鍵生成原創(chuàng)文章、方案、文案、工作計(jì)劃、工作報(bào)告、論文、代碼、作文、做題和對(duì)話答疑等等

    只需要輸入關(guān)鍵詞,就能返回你想要的內(nèi)容,越精準(zhǔn),寫出的就越詳細(xì),有微信小程序端、在線網(wǎng)頁(yè)版、PC客戶端

    官網(wǎng):https://ai.de1919.com

    創(chuàng)意嶺作為行業(yè)內(nèi)優(yōu)秀的企業(yè),服務(wù)客戶遍布全球各地,如需了解SEO相關(guān)業(yè)務(wù)請(qǐng)撥打電話175-8598-2043,或添加微信:1454722008

    本文目錄:

    如何收集圖片數(shù)據(jù)集(收集圖片的)

    一、mxnet數(shù)據(jù)集的制作和訓(xùn)練

    安裝mxnet

    Cpu版:pip install mxnet

    Gpu版:pip install mxnet-cu80

    若cuda版本為cuda-9.0,改為pip install mxnet-90

    pip或apt安裝sklearn,easydict

    制作數(shù)據(jù)集

    將圖片分類并放入不同文件夾

    運(yùn)行python im2rec.py train --list ./可生成.list文件,包含圖片列表

    運(yùn)行python im2rec.py train ./ train.rec和train.idx訓(xùn)練文件

    --train-ratio 0.9生成驗(yàn)證數(shù)據(jù)集.bin文件參數(shù)為訓(xùn)練數(shù)據(jù)集和驗(yàn)證數(shù)據(jù)集之比

    --resize 128 128指定生成數(shù)據(jù)集的圖片大小

    參考 https://github.com/apache/incubator-mxnet

    將生成的.rec,.idx,.bin(非必須)文件放入datasets/faces_emore中

    新建property文本,寫入圖片數(shù)量,圖片長(zhǎng)寬 example : 86545 128 128

    例:

    python -u  train.py --network m1 --loss softmax --dataset emore,1

    使用softma、nosoftmax、arcface或cosface訓(xùn)練完成后,使用生成模型運(yùn)行三元組損失訓(xùn)練

    例:

    Python -u train.py --network m1 -loss triplet --lr 0.005 --pretrained ./models/m1-softmax-emore

    參數(shù)說(shuō)明

    --dataset訓(xùn)練集位置,具體位置查看config.py 108至120行

    --network網(wǎng)絡(luò)模型 候選參數(shù) : r100 r100fc r50 r50v1(基于resnet) d169 d201(基于densenet) y1 y2(基于mobilefacenet) m1 m0.5(基于mobilenet) mnas mnas05 mnas025(基于mnasnet)

    --loss損失函數(shù) 候選參數(shù) :softmax(標(biāo)準(zhǔn)損失函數(shù)) nsoftmax (組合損失函數(shù))arcface cosface combined triplet(三元組損失) atriplet

    --ckpt模型存儲(chǔ)時(shí)間。0: 放棄存儲(chǔ) 1:必要時(shí)存儲(chǔ)(驗(yàn)證集準(zhǔn)確率達(dá)標(biāo)時(shí),若無(wú)驗(yàn)證集則不存儲(chǔ) 3:總是存儲(chǔ))

    --lr學(xué)習(xí)率

    --lr-steps學(xué)習(xí)率改變方法 例:’10000,20000,2200000’即達(dá)到圖片數(shù)量時(shí)學(xué)習(xí)率*0.1

    --per-batch-size每次的訓(xùn)練的數(shù)量 數(shù)量越少,占用顯卡內(nèi)存越少

    參考

    https://github.com/deepinsight/insightface/tree/master/recognition

    二、matlab中怎么從fig文件中提取數(shù)據(jù)集再繪圖

    如果兩條曲線都畫在同一個(gè)axis里面

    畫完圖之后,運(yùn)行這個(gè),gcf就是當(dāng)前fig的句柄

    ah=get(gcf,'children');

    lineh=get(ah,'children');

    x1=get(lineh(1),'xdata');

    y1=get(lineh,(1),'ydata');

    x2=get(lineh(2),'xdata');

    y2=get(lineh,(2),'ydata');

    如果圖像是用subplot分成兩幅圖畫在同一個(gè)fig里面的

    畫完圖之后,運(yùn)行這個(gè),gcf就是當(dāng)前fig句柄

    ah=get(gcf,'children');

    lineh1=get(ah(1),'children');

    x1=get(lineh1,'xdata');

    y1=get(lineh1,'ydata');

    lineh4=get(ah(2),'children');

    x2=get(lineh4,'xdata');

    y2=get(lineh4,'ydata');

    兩中情況的區(qū)別是

    一個(gè)是fig里只有1個(gè)axis,而axis中有2條曲線

    一個(gè)是fig里有2個(gè)axis,而每個(gè)axis中只有1條曲線

    三、idiap的數(shù)據(jù)集怎么申請(qǐng)啊?

    The Replay-Mobile Database for face spoofing consists of 1190 video clips of photo and video attack attempts to 40 clients, under different lighting conditions. These videos have been recorded with current devices from the market: an iPad Mini2 tablet and a LG-G4 smartphone. This database has been produced at the Idiap Research Institute (Switzerland) within the framework of collaboration with Galician Research and Development Center in Advanced Telecommunications. Gradiant (Spain).

    【用于人臉?lè)雌墼p的the Replay-Mobile Database包含嘗試使用照片和視頻進(jìn)行攻擊的1190個(gè)視頻片段,它們實(shí)在不同的燈光條件下進(jìn)行拍攝的。這些視頻都是用市場(chǎng)上現(xiàn)有的設(shè)備錄制的:一個(gè)iPad微型2平板電腦和一個(gè)LG-G4智能手機(jī)。該數(shù)據(jù)庫(kù)是在與加利西亞先進(jìn)電信研究和開(kāi)發(fā)中心合作的框架內(nèi)在idiap研究所(瑞士)制作的。 】

    Note:

    The database would have consisted of 1200 videos. For client009 (test subset), however, we were not able to collect real-access videos (the person came for only the first recording session, not the second session). Therefore, for this client, we have only videos for the enrollment and the attacks.

    【注意:該數(shù)據(jù)庫(kù)將包含1200個(gè)視頻。 然而,對(duì)于client009(測(cè)試子集),我們無(wú)法收集實(shí)際訪問(wèn)視頻(該人僅來(lái)自第一次錄制會(huì)話,而不是第二次會(huì)話)。 因此,對(duì)于此客戶,我們只有視頻用于注冊(cè)和攻擊。】

    二、欺詐攻擊描述

    Spoofing Attacks Description

    This 2D face spoofing attack database consists of 1,190 video clips of photo and video attack attempts of 40 clients, under various lighting conditions.

    【這個(gè)2D面部欺騙攻擊數(shù)據(jù)庫(kù)包含1,190個(gè)視頻剪輯,包括40個(gè)客戶在各種照明條件下的照片和視頻攻擊嘗試?!?/p>

    The data is split into 4 sub-groups:

    * Training data ("train"), to be used for training your anti-spoof classifier;

    * Development data ("devel"), to be used for threshold estimation;

    * Test data ("test"), with which to report error figures;

    * Enrollment data ("enroll"), that can be used to verify spoofing sensitivity on face detection algorithms.

    【數(shù)據(jù)分為4個(gè)子組:

    *訓(xùn)練數(shù)據(jù)(“訓(xùn)練”),用于訓(xùn)練您的反欺騙分類器;

    *用于閾值估計(jì)的開(kāi)發(fā)數(shù)據(jù)(“devel”);

    *測(cè)試數(shù)據(jù)(“測(cè)試”),用于報(bào)告錯(cuò)誤數(shù)據(jù);

    *注冊(cè)數(shù)據(jù)(“注冊(cè)”),可用于驗(yàn)證面部檢測(cè)算法的欺騙靈敏度?!?/p>

    The data-sets 'train', 'devel', and 'test' are disjoint. Clients that appear in one of these data sets (train, devel or test) do not appear in the other two sets.

    【數(shù)據(jù)集'train','devel'和'test'是不相交的。 出現(xiàn)在其中一個(gè)數(shù)據(jù)集(train,devel或test)中的客戶端不會(huì)出現(xiàn)在其他兩個(gè)數(shù)據(jù)集中?!?/p>

    三、數(shù)據(jù)集描述

    Database Description

    --------------------

    All videos are captured using the front-camera of the mobile device (tablet or mobile). The front-camera produces colour videos with a high definition resolution of 720 pixels (width) by 1280 pixels (height) which are saved in ".mov" format. The frame rate is about 25 Hz. Real accesses have been performed using the face of the genuine user. Attacks attempts have been performed by displaying a photo or a video recording of the same client for at least 10 seconds.

    【使用移動(dòng)設(shè)備(平板電腦或移動(dòng)設(shè)備)的前置攝像頭捕獲所有視頻。 前置攝像頭產(chǎn)生的彩色視頻具有720像素(寬度)×1280像素(高度)的高清晰度分辨率,以“.mov”格式保存。 幀速率約為25 Hz。 我們使用真實(shí)用戶的面部執(zhí)行了真實(shí)訪問(wèn)。 通過(guò)顯示同一客戶端的照片或視頻記錄至少10秒來(lái)執(zhí)行攻擊嘗試。】

    3.1光照條件

    Real client accesses have been recorded under five different lighting conditions:

    * **controlled** : The office light turned on, blinds down, background homogeneous

    * **adverse** : The office light turned off, blinds halfway up, background homogeneous

    * **direct** : The user captured the video in front of a window with direct sunlight, with more complex background.

    * **lateral** : The user captured the video perpendicular to the window with lateral sunlight, with more complex background.

    * **diffuse** : The user captured the video in an open hall with diffuse illumination, with more complex background.

    【在五種不同的照明條件下記錄了真實(shí)客戶訪問(wèn):

    * **控制**:辦公室燈亮,百葉窗關(guān)閉,背景均勻

    * **不利**:辦公室燈關(guān)閉,百葉窗半開(kāi),背景均勻

    * **直接**:用戶在陽(yáng)光直射的窗前拍攝視頻,背景更復(fù)雜。

    * **橫向**:用戶在側(cè)面陽(yáng)光下垂直于窗戶拍攝視頻,背景更復(fù)雜。

    * **漫反射**:用戶在開(kāi)放式大廳中拍攝視頻,漫射照明,背景更復(fù)雜?!?/p>

    【5種燈光方式加上2種拍攝設(shè)備,所以每個(gè)客戶有10個(gè)real視頻,如下】

    To produce the attacks, high-resolution photos and videos from each client have been used under similar conditions as in their authentication sessions.

    * **lighton** : The user sitting and the capturer device was holder on a tripod, the office light was turned on, blinds up, background is homogeneous

    * **lightoff** : The user sitting and the capturer device was holder on a tripod, the office light was turned off, blinds up, background is homogeneous

    【為了產(chǎn)生攻擊,來(lái)自每個(gè)客戶端的高分辨率照片和視頻在與其身份驗(yàn)證會(huì)話類似的條件下使用。

    * ** 燈亮 **:用戶坐著,捕獲器設(shè)備放在三腳架上,辦公室燈打開(kāi),百葉窗打開(kāi),背景均勻

    * **燈滅**:用戶坐著,捕捉器裝置放在三腳架上,辦公室燈關(guān)閉,百葉窗打開(kāi),背景均勻】

    3.2 攻擊數(shù)據(jù)的獲取

    For photos attacks a Nikon Coolpix P520 camera has been used. The images have been captured with 18 Mpixel resolution. Video attacks have been captured using the back-camera of a LG-G4 smartphone, which records 1080p FHD video clips through it's 16 Mpixel camera.

    【對(duì)于照片攻擊,使用了尼康Coolpix P520相機(jī)。 圖像以18 Mpixel分辨率拍攝。 而使用LG-G4智能手機(jī)的后置攝像頭捕獲視頻攻擊,該智能手機(jī)通過(guò)其1600萬(wàn)像素?cái)z像頭記錄1080p FHD視頻片段?!?/p>

    Two kinds of attacks have been performed:

    * **mattescreen** : All the attacks have been displayed on Philips 227ELH screen (resolution 1920x1080 pixels). This matte screen avoids reflections. The videos have been recorded using devices supported on a stand. Two kinds of attacks have been performed using mattescreens;

    * **photo**: a still photo of the attacked identity is displayed on the screen.

    * **video**: a video showing the attacked identity is replayed on the screen.

    * **print**: Al the attacks have been printed on Konica Minolta ineo+ 224e color laser printer. The videos have been recorded in two modes:

    * **fixed** : Using devices supported on a stand.

    * **hand** : Using devices held by the spoofer.

    In total, 16 attack videos have been recorded for each client, 8 for each of the attacking modes described above.

    【已經(jīng)進(jìn)行了兩種攻擊:

    * ** 磨砂顯示屏 **:所有攻擊都已在飛利浦227ELH屏幕上顯示(分辨率為1920x1080像素)。 這種磨砂屏幕避免了反射。視頻已使用支架上支撐的設(shè)備進(jìn)行錄制。 使用mattescreens進(jìn)行了兩種攻擊;

    * **照片**:屏幕上顯示受攻擊身份的靜態(tài)照片。

    * **視頻**:在屏幕上重播顯示受攻擊身份的視頻。

    * **打印**:這些攻擊已經(jīng)由柯尼卡美能達(dá)ineo + 224e彩色激光打印機(jī)打印。

    視頻以兩種模式錄制:

    * **固定**:使用支架上支撐的設(shè)備。

    * **手**:使用欺騙者持有的設(shè)備。

    總共為每個(gè)客戶端記錄了16個(gè)攻擊視頻,對(duì)于上述每種攻擊模式記錄了8個(gè)?!?/p>

    3.3.攻擊展示(display)類別

    * 4 x mobile attacks using a mattescreen displaying:

    * 1 x mobile photo/lighton

    * 1 x mobile photo/lightoff

    * 1 x mobile video/lighton

    * 1 x mobile video/lightoff

    * 4 x tablet attacks using a mattescreen displaying:

    * 1 x tablet photo/lighton

    * 1 x tablet photo/lightoff

    * 1 x tablet video/lighton

    * 1 x tablet video/lightoff

    * 2 x Print attacks captured by smartphone with fixed support. The print image occupied the entire available printing surface on A4 paper for the following samples:

    * 1 x high-resolution print of photo/lighton

    * 1 x high-resolution print of photo/lightoff

    * 2 x Print attacks captured by tablet with fixed support. The print image occupied the entire available printing surface on A4 paper for the following samples:

    * 1 x high-resolution print of photo/lighton

    * 1 x high-resolution print of photo/lightoff

    * 2 x Print attacks captured by hand-held smartphone. The print image occupied the entire available printing surface on A4 paper for the following samples:

    * 1 x high-resolution print of photo/lighton

    * 1 x high-resolution print of photo/lightoff

    * 2 x Print attacks captured by hand-held tablet. The print image occupied the entire available printing surface on A4 paper for the following samples:

    * 1 x high-resolution print of photo/lighton

    * 1 x high-resolution print of photo/lightoff

    【每個(gè)客戶的16種攻擊視頻舉例如下:】

    【*使用磨砂屏顯示4種移動(dòng)攻擊:

    * 1 x移動(dòng)照片/ lighton

    * 1 x移動(dòng)照片/lightoff

    * 1 x移動(dòng)視頻/ lighton

    * 1 x移動(dòng)視頻/lightoff

    *使用磨砂屏顯示的4種平板電腦攻擊:

    * 1 x平板電腦照片/ lighton

    * 1 x平板電腦照片/lightoff

    * 1 x平板電腦視頻/ lighton

    * 1 x平板電腦視頻/lightoff

    *具有固定支持的智能手機(jī)捕獲的2 種打印攻擊。打印圖像占據(jù)A4紙上的整個(gè)可用打印表面,用于以下樣本:

    * 1張高分辨率照片/lighton

    * 1張高分辨率照片/lightoff

    *具有固定支持的平板電腦捕獲的2 種打印攻擊。打印圖像占據(jù)A4紙上的整個(gè)可用打印表面,用于以下樣本:

    * 1張高分辨率照片/lighton

    * 1張高分辨率照片/lightoff

    * 2個(gè)手持智能手機(jī)拍攝的打印攻擊。打印圖像占據(jù)A4紙上的整個(gè)可用打印表面,用于以下樣本:

    * 1張高分辨率照片/lighton

    * 1張高分辨率照片/lightoff

    *手持平板電腦拍攝的2 x打印攻擊。打印圖像占據(jù)A4紙上的整個(gè)可用打印表面,用于以下樣本:

    * 1張高分辨率照片/lighton

    * 1張高分辨率照片/lightoff】

    The following images illustrate the set-up for capturing videos of attacks using a matte screen.

    ![Alt](images/mattescreen_attack_1.jpg)

    ![Alt](images/mattescreen_attack_2.jpg)

    ![Alt](images/mattescreen_attack_3.jpg)

    The images below show how print-attack videos have been captured.

    ![Alt](images/print_attack_1.jpg)

    ![Alt](images/print_attack_2.jpg)

    【以下圖像說(shuō)明了使用磨砂屏幕捕獲攻擊視頻的設(shè)置。

    ![ALT](圖像/ mattescreen_attack_1.jpg)

    ![ALT](圖像/ mattescreen_attack_2.jpg)

    ![ALT](圖像/ mattescreen_attack_3.jpg)

    下圖顯示了如何捕獲打印攻擊視頻。

    ![ALT](圖像/ print_attack_1.jpg)

    ![ALT](圖像/ print_attack_2.jpg)】

    3.4 數(shù)據(jù)集的劃分

    The 1200 real-accesses and attacks videos were then divided in the following way:

    * **Training set**: contains 120 real-accesses and 192 attacks under different lighting conditions;

    * **Development set**: contains 160 real-accesses and 256 attacks under different lighting conditions;

    * **Test set**: contains 110 real-accesses and 192 attacks under different lighting conditions;

    * **Enrollment set**: contains 160 real-accesses under various lighting conditions, to be used **exclusively** for studying the baseline performance of face recognition systems.

    【按以下方式劃分1200個(gè)實(shí)際訪問(wèn)和攻擊視頻:

    * **訓(xùn)練集**:在不同的光照條件下包含120次實(shí)際訪問(wèn)和192次攻擊;

    * **開(kāi)發(fā)集**:在不同光照條件下包含160次實(shí)際訪問(wèn)和256次攻擊;

    * **測(cè)試集**:在不同光照條件下包含110次實(shí)際訪問(wèn)和192次攻擊;

    * **注冊(cè)集**:在各種照明條件下包含160個(gè)實(shí)際訪問(wèn),僅用于**用于研究人臉識(shí)別系統(tǒng)的基線性能?!?/p>

    四、人臉定位

    Face Locations

    --------------

    We also provide face location (bounding-boxes) automatically annotated by a cascade of classifier based on a variant of Local Binary Patterns (LBP).

    The bob package [bob.ip.facedetect](https://github.com/bioidiap/bob.ip.facedetect) has been used to generate the face-locations.

    For each video, face-location is computed for each frame, and face-locations for all frames of a video are stored in a single file in a 4-column format (x,y,width, height). For each video, two versions of the face-location file are provided, one in ASCII text format (extension: .face), and the other in hdf5 format (extension: .hdf5).

    The face-location files can be found in the folder `database/faceloc`.

    【我們還提供基于局部二進(jìn)制模式(LBP)的變體由級(jí)聯(lián)分類器自動(dòng)注釋的面部位置(邊界框)。

    bob包[bob.ip.facedetect](https://github.com/bioidiap/bob.ip.facedetect)已用于生成面部位置。

    對(duì)于每個(gè)視頻,計(jì)算每個(gè)幀的面部位置,并將視頻的所有幀的面部位置存儲(chǔ)在4列的單個(gè)文件中格式(x,y,寬度,高度)。 對(duì)于每個(gè)視頻,提供兩個(gè)版本的面部位置文件,一個(gè)是ASCII文本格式(擴(kuò)展名:.face),和另一種是hdf5格式(擴(kuò)展名:.hdf5)。

    面部位置文件可以在`database / faceloc`文件夾中找到。

    四、深度學(xué)習(xí)的數(shù)據(jù)集都是怎樣生成的

    你好

    genet網(wǎng)絡(luò)的預(yù)訓(xùn)練模型訓(xùn)練自己的數(shù)據(jù)集。

    Ok首先是自己的數(shù)據(jù)集了。Matconvnet中訓(xùn)練imagenet的數(shù)據(jù)集的準(zhǔn)備不像caffe這些工具箱弄得那么好,弄個(gè)train文件夾,test文件夾,以及兩個(gè)txt索引就好了,感覺(jué)很不人性。后面我將會(huì)將其輸入改為這種人性的類型輸入格式。

    但是其類別索引是從0開(kāi)始的,這在matlab中是不符合的,所以我將其改成從1開(kāi)始的。同時(shí)添加了一個(gè)類class標(biāo)簽的txt,改完的

    下載完打開(kāi)這個(gè)文件夾看到:

    其中train就是訓(xùn)練所用到的所有圖片,test為測(cè)試所有圖片,train_label為對(duì)應(yīng)圖片的名字以及跟隨的類標(biāo)簽(從1開(kāi)始),打開(kāi)txt可以看到為:

    這種格式的txt相信應(yīng)該很容易從你自己的數(shù)據(jù)集中弄到。依次類推,test.txt中存放的是test文件夾所有圖片的名字以及其類別。

    Classind 就是每一類表示的分類的名字。

    數(shù)據(jù)準(zhǔn)備好了,放在哪呢?我們?cè)贛atconvnet的工具箱目錄下新建一個(gè)文件夾為data,然后將這個(gè)數(shù)據(jù)集放進(jìn)去,如下:

    我們是在訓(xùn)練好的model上繼續(xù)訓(xùn)練,所以需要一個(gè)model,再在這文件夾下建立一個(gè)models文件夾,然后把imagenet-vgg-f.mat放入到models里面。這里我們使用的是vgg-f的model,這個(gè)model在前兩節(jié)說(shuō)到了,自己去下載。

    接著就是網(wǎng)絡(luò)訓(xùn)練了。再建立一個(gè)文件夾train,可以編寫函數(shù)了。

    首先是主函數(shù):

    這里復(fù)制一下examples中的imagenet里面的一個(gè)主函數(shù)cnn_dicnn,然后修改一下里面的路徑,程序?yàn)椋?/p>

    滿意請(qǐng)采納

    以上就是關(guān)于如何收集圖片數(shù)據(jù)集相關(guān)問(wèn)題的回答。希望能幫到你,如有更多相關(guān)問(wèn)題,您也可以聯(lián)系我們的客服進(jìn)行咨詢,客服也會(huì)為您講解更多精彩的知識(shí)和內(nèi)容。


    推薦閱讀:

    釘釘如何創(chuàng)建ChatGPT服務(wù)(釘釘 創(chuàng)建)

    新手如何學(xué)剪輯視頻(剪輯培訓(xùn)班一般學(xué)費(fèi)多少)

    問(wèn)卷怎么發(fā)放給大量的人(如何快速收集200份問(wèn)卷)

    漂盒十大排行榜(漂盒哪家好)

    tpu基材十大排名