1、 文件头注释
# -*- coding: utf-8 -*-"""@Author : ***@License : (C) Copyright -20****@Contact : ***@File : pr*****res.py@Software: rec***nd@Time : /05/06 15:06@Desc : 0506 v1.0"""
2、函数 、类注释示例
class RandomResizedCropAndInterpolationWithTwoPic:"""Crop the given PIL Image to random size and aspect ratio with random interpolation.A crop of random size (default: of 0.08 to 1.0) of the original size and a randomaspect ratio (default: of 3/4 to 4/3) of the original aspect ratio is made. This cropis finally resized to given size.This is popularly used to train the Inception networks.Args:size: expected output size of each edgescale: range of size of the origin size croppedratio: range of aspect ratio of the origin aspect ratio croppedinterpolation: Default: PIL.Image.BILINEAR"""def __init__(self, size, second_size=None, scale=(0.08, 1.0), ratio=(3. / 4., 4. / 3.),interpolation='bilinear', second_interpolation='lanczos'):
@staticmethoddef get_params(img, scale, ratio):"""Get parameters for ``crop`` for a random sized crop.Args:img (PIL Image): Image to be cropped.scale (tuple): range of size of the origin size croppedratio (tuple): range of aspect ratio of the origin aspect ratio croppedReturns:tuple: params (i, j, h, w) to be passed to ``crop`` for a randomsized crop."""
如果觉得《python 文件头注释和函数 类注释示例》对你有帮助,请点赞、收藏,并留下你的观点哦!