forked from RelevanceAI/vectorhub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
encoders.image.inception_resnet2vec.html
445 lines (309 loc) · 30.4 KB
/
encoders.image.inception_resnet2vec.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>InceptionResnet2Vec — VectorHub 0.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="MobileNet2Vec" href="encoders.image.mobilenet2vec.html" />
<link rel="prev" title="ResNet2Vec" href="encoders.image.resnet2vec.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> VectorHub
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Contents</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html">What is Vector Hub?</a></li>
<li class="toctree-l1"><a class="reference internal" href="how_to_add_a_model.html">How To Add Your Model To Vector Hub</a></li>
<li class="toctree-l1"><a class="reference internal" href="auto_encoder.html">Guide to using Auto-Encoder</a></li>
</ul>
<p class="caption"><span class="caption-text">Text Encoders</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.bert2vec.html">Bert2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.albert2vec.html">AlBert2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.labse2vec.html">LaBSE2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.use2vec.html">USE2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.use_multi2vec.html">USEMulti2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.legalbert2vec.html">LegalBert2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.transformer2vec.html">Transformer2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.sentencetransformer2vec.html">SentenceTransformer2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.text.vectorai2vec.html">ViText2Vec</a></li>
</ul>
<p class="caption"><span class="caption-text">Image Encoders</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="encoders.image.bit2vec.html">Bit2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.image.inception2vec.html">Inception2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.image.resnet2vec.html">ResNet2Vec</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">InceptionResnet2Vec</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-vectorhub.encoders.image.tfhub.inception_resnet">TFHub</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="encoders.image.mobilenet2vec.html">MobileNet2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.image.vectorai2vec.html">ViImage2Vec</a></li>
</ul>
<p class="caption"><span class="caption-text">Audio Encoders</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="encoders.audio.speech_embedding2vec.html">SpeechEmbedding2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.audio.trill2vec.html">Trill2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.audio.vggish2vec.html">Vggish2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.audio.yamnet2vec.html">Yamnet2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.audio.wav2vec.html">Wav2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="encoders.audio.vectorai2vec.html">ViAudio2Vec</a></li>
</ul>
<p class="caption"><span class="caption-text">Text Bi-Encoders</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="bi_encoders.text_text.use_qa2vec.html">USEQA2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="bi_encoders.text_text.lareqa_qa2vec.html">LAReQA2Vec</a></li>
<li class="toctree-l1"><a class="reference internal" href="bi_encoders.text_text.dpr2vec.html">DPR2Vec</a></li>
</ul>
<p class="caption"><span class="caption-text">Modules</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="modules.html">vectorhub</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">VectorHub</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li>InceptionResnet2Vec</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/encoders.image.inception_resnet2vec.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="inceptionresnet2vec">
<h1>InceptionResnet2Vec<a class="headerlink" href="#inceptionresnet2vec" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-vectorhub.encoders.image.tfhub.inception_resnet">
<span id="tfhub"></span><h2>TFHub<a class="headerlink" href="#module-vectorhub.encoders.image.tfhub.inception_resnet" title="Permalink to this headline">¶</a></h2>
<p><strong>Model Name</strong>: Inception Resnet</p>
<p><strong>Vector Length</strong>: 1536 (default)</p>
<p><strong>Description</strong>:
Very deep convolutional networks have been central to the largest advances in image recognition performance in
recent years. One example is the Inception architecture that has been shown to achieve very good performance at
relatively low computational cost. Recently, the introduction of residual connections in conjunction with a more traditional
architecture has yielded state-of-the-art performance in the 2015 ILSVRC challenge; its performance was similar to the latest
generation Inception-v3 network. This raises the question of whether there are any benefit in combining the Inception architecture
with residual connections. Here we give clear empirical evidence that training with residual connections accelerates the training
of Inception networks significantly. There is also some evidence of residual Inception networks outperforming similarly expensive
Inception networks without residual connections by a thin margin. We also present several new streamlined architectures for both
residual and non-residual Inception networks. These variations improve the single-frame recognition performance on the ILSVRC 2012
classification task significantly. We further demonstrate how proper activation scaling stabilizes the training of very wide residual
Inception networks. With an ensemble of three residual and one Inception-v4, we achieve 3.08 percent top-5 error on the test set of the
ImageNet classification (CLS) challenge.</p>
<p><strong>Paper</strong>: <a class="reference external" href="https://arxiv.org/abs/1602.07261">https://arxiv.org/abs/1602.07261</a></p>
<p><strong>Repository</strong>: <a class="reference external" href="https://tfhub.dev/google/imagenet/inception_resnet_v2/feature_vector/4">https://tfhub.dev/google/imagenet/inception_resnet_v2/feature_vector/4</a></p>
<p><strong>Architecture</strong>: Not stated.</p>
<p><strong>Tasks</strong>: Not stated.</p>
<p><strong>Release Date</strong>: 2016-02-23</p>
<p><strong>Limitations</strong>: Not stated.</p>
<p><strong>Installation</strong>: <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">vectorhub[encoders-image-tfhub]</span></code></p>
<p><strong>Example</strong>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">`python</span>
<span class="pre">#pip</span> <span class="pre">install</span> <span class="pre">vectorhub[encoders-image-tfhub]</span>
<span class="pre">from</span> <span class="pre">vectorhub.encoders.image.tfhub</span> <span class="pre">import</span> <span class="pre">InceptionResnet2Vec</span>
<span class="pre">model</span> <span class="pre">=</span> <span class="pre">InceptionResnet2Vec()</span>
<span class="pre">sample</span> <span class="pre">=</span> <span class="pre">model.read('https://getvectorai.com/assets/hub-logo-with-text.png')</span>
<span class="pre">model.encode(sample)</span>
<span class="pre">`</span></code></p>
<dl class="py class">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">vectorhub.encoders.image.tfhub.inception_resnet.</span></code><code class="sig-name descname"><span class="pre">InceptionResnet2Vec</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model_url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'https://tfhub.dev/google/imagenet/inception_resnet_v2/feature_vector/4'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="vectorhub.encoders.image.html#vectorhub.encoders.image.base.BaseImage2Vec" title="vectorhub.encoders.image.base.BaseImage2Vec"><code class="xref py py-class docutils literal notranslate"><span class="pre">vectorhub.encoders.image.base.BaseImage2Vec</span></code></a></p>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.add_documents">
<code class="sig-name descname"><span class="pre">add_documents</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">api_key</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">items</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">collection_name</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.add_documents" title="Permalink to this definition">¶</a></dt>
<dd><p>Add documents to the Vector AI cloud.</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.bulk_encode">
<code class="sig-name descname"><span class="pre">bulk_encode</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">images</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.bulk_encode" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.chunk">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">chunk</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lst</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">chunk_size</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.chunk" title="Permalink to this definition">¶</a></dt>
<dd><p>Chunk an iterable object in Python but not a pandas DataFrame.
:param lst: Python List
:param chunk_size: The chunk size of an object.</p>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">documents</span> <span class="o">=</span> <span class="p">[{</span><span class="o">...</span><span class="p">}]</span>
<span class="gp">>>> </span><span class="n">ViClient</span><span class="o">.</span><span class="n">chunk</span><span class="p">(</span><span class="n">documents</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.definition">
<code class="sig-name descname"><span class="pre">definition</span></code><em class="property"> <span class="pre">=</span> <span class="pre"><vectorhub.doc_utils.ModelDefinition</span> <span class="pre">object></span></em><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.definition" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.delete_collection">
<code class="sig-name descname"><span class="pre">delete_collection</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">collection_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.delete_collection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.encode">
<code class="sig-name descname"><span class="pre">encode</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">image</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.encode" title="Permalink to this definition">¶</a></dt>
<dd><p>Encode an image using InceptionResnet.</p>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">vectorhub.image.encoder.tfhub</span> <span class="kn">import</span> <span class="n">inception_resnet</span>
<span class="gp">>>> </span><span class="n">model</span> <span class="o">=</span> <span class="n">InceptionResnet2Vec</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">api_key</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">model</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s2">"Hey!"</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.encoder_type">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">encoder_type</span></code><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.encoder_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The encoder type ensures it uses either the ‘encode’ or ‘encode_question’/’encode_answer’
Currently supported encoder types:</p>
<blockquote>
<div><p>Question-Answer
Text-Image
Encoder</p>
</div></blockquote>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.get_vector_field_name">
<code class="sig-name descname"><span class="pre">get_vector_field_name</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.get_vector_field_name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.image_resize">
<code class="sig-name descname"><span class="pre">image_resize</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">image_array</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rescale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">resize_mode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'symmetric'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.image_resize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.is_url_working">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">is_url_working</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.is_url_working" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.read">
<code class="sig-name descname"><span class="pre">read</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">image</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.read" title="Permalink to this definition">¶</a></dt>
<dd><p>An method to read images.
:param image: An image link/bytes/io Bytesio data format.
:param as_gray: read in the image as black and white</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.request_api_key">
<code class="sig-name descname"><span class="pre">request_api_key</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">email</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">referral_code</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'vectorhub_referred'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.request_api_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Requesting an API key.</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.retrieve_all_documents">
<code class="sig-name descname"><span class="pre">retrieve_all_documents</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.retrieve_all_documents" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve all documents.</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.retrieve_documents">
<code class="sig-name descname"><span class="pre">retrieve_documents</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num_of_documents</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.retrieve_documents" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all the documents in our package.</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.rgb_weights">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">rgb_weights</span></code><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.rgb_weights" title="Permalink to this definition">¶</a></dt>
<dd><p>Get RGB weights for grayscaling.</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.search">
<code class="sig-name descname"><span class="pre">search</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">item</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Any</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_results</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">int</span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">10</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.search" title="Permalink to this definition">¶</a></dt>
<dd><p>Simple search with Vector AI</p>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.show_image">
<code class="sig-name descname"><span class="pre">show_image</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sample</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cmap</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_grayscale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.show_image" title="Permalink to this definition">¶</a></dt>
<dd><p>Show an image once it is read.
Arg:</p>
<blockquote>
<div><p>sample: Image that is read (numpy array)</p>
</div></blockquote>
</dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.to_grayscale">
<code class="sig-name descname"><span class="pre">to_grayscale</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sample</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rgb_weights</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.to_grayscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Converting an image from RGB to Grayscale</p>
</dd></dl>
<dl class="py attribute">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.urls">
<code class="sig-name descname"><span class="pre">urls</span></code><em class="property"> <span class="pre">=</span> <span class="pre">{'https://tfhub.dev/google/imagenet/inception_resnet_v2/feature_vector/4':</span> <span class="pre">{'vector_length':</span> <span class="pre">1536}}</span></em><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.validate_model_url">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">validate_model_url</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model_url</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">list_of_urls</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#vectorhub.encoders.image.tfhub.inception_resnet.InceptionResnet2Vec.validate_model_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Validate the model url belongs in the list of urls. This is to help
users to avoid mis-spelling the name of the model.</p>
<p># TODO:
Improve model URL validation to not include final number in URl string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model_url</strong> – The URl of the the model in question</p></li>
<li><p><strong>list_of_urls</strong> – The list of URLS for the model in question</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="encoders.image.mobilenet2vec.html" class="btn btn-neutral float-right" title="MobileNet2Vec" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="encoders.image.resnet2vec.html" class="btn btn-neutral float-left" title="ResNet2Vec" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2020, Vector AI.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>