91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 25KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-03
  • 語言: 其他
  • 標簽: dlib??imglab??

資源簡介

dlib提供的工具,用來制作數據集。打標簽,最后會生成一個xml文件,可以在程序中調用。用于訓練模型。

資源截圖

代碼片段和文件信息

//?Copyright?(C)?2015??Davis?E.?King?(davis@dlib.net)
//?License:?Boost?Software?License???See?LICENSE.txt?for?the?full?license.

#include?“cluster.h“?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

//?----------------------------------------------------------------------------------------

using?namespace?std;
using?namespace?dlib;

//??----------------------------------------------------------------------------

struct?assignment
{
????unsigned?long?c;
????double?dist;
????unsigned?long?idx;

????bool?operator<(const?assignment&?item)?const
????{?return?dist?};

std::vector?angular_cluster?(
????std::vector?>?feats
????const?unsigned?long?num_clusters

{
????DLIB_CASSERT(feats.size()?!=?0?“The?dataset?can‘t?be?empty“);
????for?(unsigned?long?i?=?0;?i?????{
????????DLIB_CASSERT(feats[i].size()?==?feats[0].size()?“All?feature?vectors?must?have?the?same?length.“);
????}

????//?find?the?centroid?of?feats
????matrix?m;
????for?(unsigned?long?i?=?0;?i?????????m?+=?feats[i];
????m?/=?feats.size();

????//?Now?center?feats?and?then?project?onto?the?unit?sphere.??The?reason?for?projecting
????//?onto?the?unit?sphere?is?so?pick_initial_centers()?works?in?a?sensible?way.
????for?(unsigned?long?i?=?0;?i?????{
????????feats[i]?-=?m;
????????double?len?=?length(feats[i]);
????????if?(len?!=?0)
????????????feats[i]?/=?len;
????}

????//?now?do?angular?clustering?of?the?points
????std::vector?>?centers;
????pick_initial_centers(num_clusters?centers?feats?linear_kernel?>()?0.05);
????find_clusters_using_angular_kmeans(feats?centers);

????//?and?then?report?the?resulting?assignments
????std::vector?assignments;
????for?(unsigned?long?i?=?0;?i?????{
????????assignment?temp;
????????temp.c?=?nearest_center(centers?feats[i]);
????????temp.dist?=?length(feats[i]?-?centers[temp.c]);
????????temp.idx?=?i;
????????assignments.push_back(temp);
????}
????return?assignments;
}

//?----------------------------------------------------------------------------------------

bool?compare_first?(
????const?std::pairtadata::image>&?a
????const?std::pairtadata::image>&?b

{
????return?a.first?}

//?----------------------------------------------------------------------------------------

double?mean_aspect_ratio?(
????const?image_dataset_metadata::dataset&?data

{
????double?sum?=?0;
????double?cnt?=?0;
????for?(unsigned?long?i?=?0;?i?????{
????????for?(unsigned?long?j?=?0;?j?????????{
????????????rectangle?rect?=?data.images[i].boxes[j].rect;
????????????if?(rect.area()?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-11-03?20:16??imglab\
?????文件????????1037??2017-11-03?20:16??imglab\CMakeLists.txt
?????文件????????1814??2017-11-03?20:16??imglab\README.txt
?????文件?????????554??2017-11-03?20:16??imglab\convert_imglab_paths_to_relative
?????文件?????????756??2017-11-03?20:16??imglab\copy_imglab_dataset
?????目錄???????????0??2017-11-03?20:16??imglab\src\
?????文件????????9033??2017-11-03?20:16??imglab\src\cluster.cpp
?????文件?????????323??2017-11-03?20:16??imglab\src\cluster.h
?????文件????????1015??2017-11-03?20:16??imglab\src\common.cpp
?????文件?????????974??2017-11-03?20:16??imglab\src\common.h
?????文件????????4269??2017-11-03?20:16??imglab\src\convert_idl.cpp
?????文件?????????358??2017-11-03?20:16??imglab\src\convert_idl.h
?????文件????????5453??2017-11-03?20:16??imglab\src\convert_pascal_v1.cpp
?????文件?????????381??2017-11-03?20:16??imglab\src\convert_pascal_v1.h
?????文件????????6997??2017-11-03?20:16??imglab\src\convert_pascal_xml.cpp
?????文件?????????384??2017-11-03?20:16??imglab\src\convert_pascal_xml.h
?????文件???????48444??2017-11-03?20:16??imglab\src\main.cpp
?????文件???????21340??2017-11-03?20:16??imglab\src\metadata_editor.cpp
?????文件????????3118??2017-11-03?20:16??imglab\src\metadata_editor.h

評論

共有 條評論