UNPKG

2.08 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2020 Google LLC. All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 * =============================================================================
16 */
17/// <amd-module name="@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor" />
18import { Tensor3D, Tensor4D } from '../../tensor';
19import { TensorLike } from '../../types';
20/**
21 * NearestNeighbor resize a batch of 3D images to a new shape.
22 *
23 * @param images The images, of rank 4 or rank 3, of shape
24 * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
25 * @param size The new shape `[newHeight, newWidth]` to resize the
26 * images to. Each channel is resized individually.
27 * @param alignCorners Defaults to False. If true, rescale
28 * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4
29 * corners of images and resized images. If false, rescale by
30 * `new_height / height`. Treat similarly the width dimension.
31 * @param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of
32 * half the actual dimensions, and yields more accurate resizes. This flag
33 * would also make the floating point coordinates of the top left pixel
34 * 0.5, 0.5.
35 *
36 * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}
37 */
38declare function resizeNearestNeighbor_<T extends Tensor3D | Tensor4D>(images: T | TensorLike, size: [number, number], alignCorners?: boolean, halfPixelCenters?: boolean): T;
39export declare const resizeNearestNeighbor: typeof resizeNearestNeighbor_;
40export {};