
    Wpf5j                        d Z ddlmZ ddlmZ ddlmZ ddlZddlmc mZ	 d Z
d3dZd Zd4d
Zd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZd4dZ d4dZ!d4dZ"d4d Z#d4d!Z$d4d"Z%d4d#Z&d4d$Z'd4d%Z(d4d&Z)d5d'Z*d5d(Z+d5d)Z,d5d*Z-d5d+Z.d5d,Z/d5d-Z0d5d.Z1d5d/Z2d5d0Z3d5d1Z4d5d2Z5dS )6a  Copyright 2019 The MediaPipe Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Utilities for creating MediaSequence functions.

A set of lightweight functions to simplify access to tensorflow SequenceExample
features and functions to create getters and setters for common types.
    )absolute_import)division)print_functionNc                 \    t          j        | j        | j        | j        |f| j                  S )z5Creates a new function with a default last parameter.)typesFunctionType__code____globals____name____closure__)fdefaults     k/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/mediapipe/util/sequence/media_sequence_util.pyfunction_with_defaultr      s,    		AJqz$J
7 
7 7    c                 F    |t                      }| D ]}| |         ||<   dS )a  Adds functions to another module.

  Args:
    function_dict: a list of names and function references. The functions will
      be accessible in the new module by the name.
    module_dict: The results of globals() for the current module or
      a_module.__dict__() call. Adding values to these dicts makes the functions
      accessible from the module. If not specified, globals() is used.
  N)globals)function_dictmodule_dictnames      r   add_functions_to_moduler   #   s>     ))K , ,d%d+K, ,r   c                 8    | rd                     | |f          S |S )N/)joinprefixkeys     r   merge_prefixr   3   s%     88VSM"""Jr    c                 :    t          ||           |j        j        v S N)r   contextfeaturer   sequencer   s      r   has_contextr&   :   s    	fc	"	"h&6&>	>>r   c                 <    |j         j        t          ||           = d S r!   )r"   r#   r   r$   s      r   clear_contextr(   >   s     |FC88999r   c                 f    |f|j         j        t          ||                    j        j        d d <   d S r!   r"   r#   r   
float_listvaluer   r,   r%   r   s       r   set_context_floatr.   B   s7    M(<445@FqqqIIIr   c                 b    |j         j        t          ||                    j        j        d         S Nr   r*   r$   s      r   get_context_floatr1   G   s2    			!,c# # 
uQ
( (r   c                 f    |f|j         j        t          ||                    j        j        d d <   d S r!   r"   r#   r   
bytes_listr,   r-   s       r   set_context_bytesr5   L   B    +0( <c  uQQQ( ( (r   c                 b    |j         j        t          ||                    j        j        d         S r0   r3   r$   s      r   get_context_bytesr8   Q   (    			!,vs";";	<	G	Ma	PPr   c                 f    |f|j         j        t          ||                    j        j        d d <   d S r!   r"   r#   r   
int64_listr,   r-   s       r   set_context_intr=   U   r6   r   c                 b    |j         j        t          ||                    j        j        d         S r0   r;   r$   s      r   get_context_intr?   Z   r9   r   c                 d    ||j         j        t          ||                    j        j        d d <   d S r!   r*   r-   s       r   set_context_float_listrA   ^   @    */ <c  uQQQ( ( (r   c                 V    |j         j        t          ||                    j        j        S r!   r*   r$   s      r   get_context_float_listrD   c   #    			!,vs";";	<	G	MMr   c                 d    ||j         j        t          ||                    j        j        d d <   d S r!   r3   r-   s       r   set_context_bytes_listrG   g   rB   r   c                 V    |j         j        t          ||                    j        j        S r!   r3   r$   s      r   get_context_bytes_listrI   l   rE   r   c                 d    ||j         j        t          ||                    j        j        d d <   d S r!   r;   r-   s       r   set_context_int_listrK   p   rB   r   c                 V    |j         j        t          ||                    j        j        S r!   r;   r$   s      r   get_context_int_listrM   u   rE   r   c                 :    t          ||           |j        j        v S r!   )r   feature_listsfeature_listr$   s      r   has_feature_listrQ   y   s    	fc	"	"h&<&I	IIr   c                     t          t          ||           |          r2t          |j        j        t          ||                    j                  S dS r0   )rQ   r   lenrO   rP   r#   r$   s      r   get_feature_list_sizerT   }   sX    l63//:: x%2<4 4    1r   c                 <    |j         j        t          ||           = d S r!   )rO   rP   r   r$   s      r   clear_feature_listrV      s     ),vs*C*CDDDr   c                 l    |j         j        t          ||                    j        |         j        j        S r!   rO   rP   r   r#   r+   r,   r   indexr%   r   s       r   get_float_list_atr[      /    			,\&#-F-F	G	O
r   c                 l    |j         j        t          ||                    j        |         j        j        S r!   rO   rP   r   r#   r<   r,   rY   s       r   get_int_list_atr_      r\   r   c                 l    |j         j        t          ||                    j        |         j        j        S r!   rO   rP   r   r#   r4   r,   rY   s       r   get_bytes_list_atrb      r\   r   c                     ||j         j        t          ||                    j                                        j        j        d d <   d S r!   rO   rP   r   r#   addr+   r,   r   valuesr%   r   s       r   add_float_listrh      L      %l63&?&?@HLL  uQQQ  r   c                     ||j         j        t          ||                    j                                        j        j        d d <   d S r!   rO   rP   r   r#   re   r4   r,   rf   s       r   add_bytes_listrl      ri   r   c                     ||j         j        t          ||                    j                                        j        j        d d <   d S r!   rO   rP   r   r#   re   r<   r,   rf   s       r   add_int_listro      ri   r   c                 x    |j         j        t          ||                    j        |         j        j        d         S r0   rX   rY   s       r   get_float_atrq      6    			,\&#-F-F	G	O
a
! !r   c                 x    |j         j        t          ||                    j        |         j        j        d         S r0   r^   rY   s       r   
get_int_atrt      rr   r   c                 x    |j         j        t          ||                    j        |         j        j        d         S r0   ra   rY   s       r   get_bytes_atrv      rr   r   c                     |f|j         j        t          ||                    j                                        j        j        d d <   d S r!   rd   r-   s       r   	add_floatrx      N     ( %l63&?&?@HLL  uQQQ  r   c                     |f|j         j        t          ||                    j                                        j        j        d d <   d S r!   rk   r-   s       r   	add_bytesr{      ry   r   c                     |f|j         j        t          ||                    j                                        j        j        d d <   d S r!   rn   r-   s       r   add_intr}      ry   r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}d }	d| z   |d| z   |d	| z   |d
| z   |d| z   dz   |d| z   dz   |	i}
t          |
|           dS )a  Creates accessor functions for list of bytes features.

  The provided functions are has_${NAME}, get_${NAME}, set_${NAME} and
  clear_${NAME}.

  Example:
    example = tensorflow.train.SequenceExample()
    set_clip_label_string(["dog", "cat"], example)
    if has_clip_label_string(example):
      clip_label_string = get_clip_label_string(example)
      clear_clip_label_string(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S N)r   r&   sequence_exampler   r   s     r   _hasz/create_bytes_list_context_feature.<locals>._has       s,V<<<<r   c                 (    t          | |          S r   )rI   r   s     r   _getz/create_bytes_list_context_feature.<locals>._get       !#'7GGGGr   c                 ,    t          | |           d S r   r(   r   s     r   _clearz1create_bytes_list_context_feature.<locals>._clear       #'777777r   c                 .    t          | ||           d S r   )rG   r,   r   r   r   s      r   _setz/create_bytes_list_context_feature.<locals>._set   !    3'7GGGGGGr   c                 $    t          |           S r!   r   r   s    r   _get_keyz3create_bytes_list_context_feature.<locals>._get_key       $$$r   c                  T    t           j                            t           j                  S r!   tfioVarLenFeaturestring r   r   _get_default_parserz>create_bytes_list_context_feature.<locals>._get_default_parser       5ry)))r   has_get_clear_set__key_default_parserNr   r   r   r   r   r   r   r   r   r   r   r   s    `         r   !create_bytes_list_context_featurer      s0   & %+ = = = = = = %+ H H H H H H '- 8 8 8 8 8 8 ,2 H H H H H H  % % % % % %* * * tmTtmTovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}d }	d| z   |d| z   |d	| z   |d
| z   |d| z   dz   |d| z   dz   |	i}
t          |
|           dS )a  Creates accessor functions for list of floats features.

  The provided functions are has_${NAME}, get_${NAME}, set_${NAME} and
  clear_${NAME}.

  Example:
    example = tensorflow.train.SequenceExample()
    set_segment_label_confidence([0.47, 0.49], example)
    if has_segment_label_confidence(example):
      confidences = get_segment_label_confidence(example)
      clear_segment_label_confidence(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z/create_float_list_context_feature.<locals>._has  r   r   c                 (    t          | |          S r   )rD   r   s     r   r   z/create_float_list_context_feature.<locals>._get  r   r   c                 ,    t          | |           d S r   r   r   s     r   r   z1create_float_list_context_feature.<locals>._clear  r   r   c                 .    t          | ||           d S r   )rA   r   s      r   r   z/create_float_list_context_feature.<locals>._set  r   r   c                 $    t          |           S r!   r   r   s    r   r   z3create_float_list_context_feature.<locals>._get_key  r   r   c                  T    t           j                            t           j                  S r!   r   r   r   float32r   r   r   r   z>create_float_list_context_feature.<locals>._get_default_parser      5rz***r   r   r   r   r   r   r   Nr   r   s    `         r   !create_float_list_context_featurer      s0   & %+ = = = = = = %+ H H H H H H '- 8 8 8 8 8 8 ,2 H H H H H H  % % % % % %+ + + tmTtmTovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}d }	d| z   |d| z   |d	| z   |d
| z   |d| z   dz   |d| z   dz   |	i}
t          |
|           dS )a  Creates accessor functions for list of int64 features.

  The provided functions are has_${NAME}, get_${NAME}, set_${NAME} and
  clear_${NAME}.

  Example:
    example = tensorflow.train.SequenceExample()
    set_clip_label_index([0, 1, 2, 3], example)
    if has_clip_label_index(example):
      clip_label_index = get_clip_label_index(example)
      clear_clip_label_index

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z-create_int_list_context_feature.<locals>._has8  r   r   c                 (    t          | |          S r   )rM   r   s     r   r   z-create_int_list_context_feature.<locals>._get;  s    %5fEEEEr   c                 ,    t          | |           d S r   r   r   s     r   r   z/create_int_list_context_feature.<locals>._clear>  r   r   c                 .    t          | ||           d S r   )rK   r   s      r   r   z-create_int_list_context_feature.<locals>._setA  s!    e%5fEEEEEEr   c                 $    t          |           S r!   r   r   s    r   r   z1create_int_list_context_feature.<locals>._get_keyD  r   r   c                  T    t           j                            t           j                  S r!   r   r   r   int64r   r   r   r   z<create_int_list_context_feature.<locals>._get_default_parserG      5rx(((r   r   r   r   r   r   r   Nr   r   s    `         r   create_int_list_context_featurer   %  s0   & %+ = = = = = = %+ F F F F F F '- 8 8 8 8 8 8 ,2 F F F F F F  % % % % % %) ) ) tmTtmTovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}d }	d| z   |d| z   |d	| z   |d
| z   |d| z   dz   |d| z   dz   |	i}
t          |
|           dS )ac  Creates accessor functions for single bytes features.

  The provided functions are has_${NAME}, get_${NAME}, set_${NAME} and
  clear_${NAME}.

  Example:
    example = tensorflow.train.SequenceExample()
    set_data_path("path_to_a_file", example)
    if has_data_path(example):
      path = get_data_path(example)
      clear_data_path(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z*create_bytes_context_feature.<locals>._hash  r   r   c                 (    t          | |          S r   )r8   r   s     r   r   z*create_bytes_context_feature.<locals>._getk      S"26BBBBr   c                 ,    t          | |           d S r   r   r   s     r   r   z,create_bytes_context_feature.<locals>._clearn  r   r   c                 .    t          | ||           d S r   )r5   r   s      r   r   z*create_bytes_context_feature.<locals>._setq  !    c5"26BBBBBBr   c                 $    t          |           S r!   r   r   s    r   r   z.create_bytes_context_feature.<locals>._get_keyt  r   r   c                  V    t           j                            dt           j                  S Nr   )r   r   FixedLenFeaturer   r   r   r   r   z9create_bytes_context_feature.<locals>._get_default_parserw  s    5  RY///r   r   r   r   r   r   r   Nr   r   s    `         r   create_bytes_context_featurer   U  s0   & %+ = = = = = = %+ C C C C C C '- 8 8 8 8 8 8 ,2 C C C C C C  % % % % % %0 0 0 tmTtmTovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}d }	d| z   |d| z   |d	| z   |d
| z   |d| z   dz   |d| z   dz   |	i}
t          |
|           dS )a  Creates accessor functions for single float features.

  The provided functions are has_${NAME}, get_${NAME}, set_${NAME} and
  clear_${NAME}.

  Example:
    example = tensorflow.train.SequenceExample()
    set_image_frame_rate(0.47, example)
    if has_image_frame_rate(example):
      image_frame_rate = get_image_frame_rate(example)
      clear_image_frame_rate(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z*create_float_context_feature.<locals>._has  r   r   c                 (    t          | |          S r   )r1   r   s     r   r   z*create_float_context_feature.<locals>._get  r   r   c                 ,    t          | |           d S r   r   r   s     r   r   z,create_float_context_feature.<locals>._clear  r   r   c                 .    t          | ||           d S r   )r.   r   s      r   r   z*create_float_context_feature.<locals>._set  r   r   c                 $    t          |           S r!   r   r   s    r   r   z.create_float_context_feature.<locals>._get_key  r   r   c                  V    t           j                            dt           j                  S r   )r   r   r   r   r   r   r   r   z9create_float_context_feature.<locals>._get_default_parser  s    5  RZ000r   r   r   r   r   r   r   Nr   r   s    `         r   create_float_context_featurer     s0   & %+ = = = = = = %+ C C C C C C '- 8 8 8 8 8 8 ,2 C C C C C C  % % % % % %1 1 1 tmTtmTovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}d }	d| z   |d| z   |d	| z   |d
| z   |d| z   dz   |d| z   dz   |	i}
t          |
|           dS )ad  Creates accessor functions for single int64 features.

  The provided functions are has_${NAME}, get_${NAME}, set_${NAME} and
  clear_${NAME}.

  Example:
    example = tensorflow.train.SequenceExample()
    set_clip_frames(47, example)
    if has_clip_frames(example):
      clip_frames = get_clip_frames(example)
      clear_clip_frames(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z(create_int_context_feature.<locals>._has  r   r   c                 (    t          | |          S r   )r?   r   s     r   r   z(create_int_context_feature.<locals>._get  s    3 0@@@@r   c                 ,    t          | |           d S r   r   r   s     r   r   z*create_int_context_feature.<locals>._clear  r   r   c                 .    t          | ||           d S r   )r=   r   s      r   r   z(create_int_context_feature.<locals>._set  s!    C 0@@@@@@r   c                 $    t          |           S r!   r   r   s    r   r   z,create_int_context_feature.<locals>._get_key  r   r   c                  V    t           j                            dt           j                  S r   )r   r   r   r   r   r   r   r   z7create_int_context_feature.<locals>._get_default_parser  s    5  RX...r   r   r   r   r   r   r   Nr   r   s    `         r   create_int_context_featurer     s0   & %+ = = = = = = %+ A A A A A A '- 8 8 8 8 8 8 ,2 A A A A A A  % % % % % %/ / / tmTtmTovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}|ffd	}	d }
d| z   |d	| z   d
z   |d	| z   dz   |d| z   |d| z   |d	| z   dz   |	d	| z   dz   |
i}t          ||           dS )a  Creates accessor functions for bytes feature lists.

  The provided functions are has_${NAME}, get_${NAME}_size, get_${NAME}_at,
  clear_${NAME}, and add_${NAME}.

  example = tensorflow.train.SequenceExample()
  add_image_encoded(1000000, example)
  add_image_encoded(2000000, example)
  if has_image_encoded:
    for i in range(get_image_encoded_size(example):
      image_encoded = get_image_encoded_at(i, example)
    clear_image_encoded(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   rQ   r   s     r   r   z'create_bytes_feature_list.<locals>._has      C!1&AAAAr   c                 (    t          | |          S r   rT   r   s     r   	_get_sizez,create_bytes_feature_list.<locals>._get_size       &6vFFFFr   c                 *    t          | ||          S r   )rv   rZ   r   r   r   s      r   _get_atz*create_bytes_feature_list.<locals>._get_at      U$4VDDDDr   c                 ,    t          | |           d S r   rV   r   s     r   r   z)create_bytes_feature_list.<locals>._clear      s,V<<<<<<r   c                 .    t          | ||           d S r   )r{   r   s      r   _addz'create_bytes_feature_list.<locals>._add  !    c5*6::::::r   c                 $    t          |           S r!   r   r   s    r   r   z+create_bytes_feature_list.<locals>._get_key  r   r   c                  V    t           j                            dt           j                  S r   )r   r   FixedLenSequenceFeaturer   r   r   r   r   z6create_bytes_feature_list.<locals>._get_default_parser  s    5((RY777r   r   r   _size_atr   add_r   r   Nr   r   r   r   r   r   r   r   r   r   r   r   r   s    `          r   create_bytes_feature_listr     sl   ( %+ B B B B B B *0 G G G G G G /5 E E E E E E '- = = = = = = ,2 ; ; ; ; ; ;  % % % % % %8 8 8 tmTtmgytmeWovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}|ffd	}	d }
d| z   |d	| z   d
z   |d	| z   dz   |d| z   |d| z   |d	| z   dz   |	d	| z   dz   |
i}t          ||           dS )a  Creates accessor functions for float feature lists.

  The provided functions are has_${NAME}, get_${NAME}_size, get_${NAME}_at,
  clear_${NAME}, and add_${NAME}.

  example = tensorflow.train.SequenceExample()
  add_confidence(0.47, example)
  add_confidence(0.49, example)
  if has_confidence:
    for i in range(get_confidence_size(example):
      confidence = get_confidence_at(i, example)
    clear_confidence(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z'create_float_feature_list.<locals>._has.  r   r   c                 (    t          | |          S r   r   r   s     r   r   z,create_float_feature_list.<locals>._get_size1  r   r   c                 *    t          | ||          S r   )rq   r   s      r   r   z*create_float_feature_list.<locals>._get_at4  r   r   c                 ,    t          | |           d S r   r   r   s     r   r   z)create_float_feature_list.<locals>._clear7  r   r   c                 .    t          | ||           d S r   )rx   r   s      r   r   z'create_float_feature_list.<locals>._add:  r   r   c                 $    t          |           S r!   r   r   s    r   r   z+create_float_feature_list.<locals>._get_key=  r   r   c                  V    t           j                            dt           j                  S r   )r   r   r   r   r   r   r   r   z6create_float_feature_list.<locals>._get_default_parser@  s    5((RZ888r   r   r   r   r   r   r   r   r   Nr   r   s    `          r   create_float_feature_listr     sl   ( %+ B B B B B B *0 G G G G G G /5 E E E E E E '- = = = = = = ,2 ; ; ; ; ; ;  % % % % % %9 9 9 tmTtmgytmeWovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}|ffd	}	d }
d| z   |d	| z   d
z   |d	| z   dz   |d| z   |d| z   |d	| z   dz   |	d	| z   dz   |
i}t          ||           dS )a  Creates accessor functions for bytes feature lists.

  The provided functions are has_${NAME}, get_${NAME}_size, get_${NAME}_at,
  clear_${NAME}, and add_${NAME}.

  example = tensorflow.train.SequenceExample()
  add_image_timestamp(1000000, example)
  add_image_timestamp(2000000, example)
  if has_image_timestamp:
    for i in range(get_image_timestamp_size(example):
      timestamp = get_image_timestamp_at(i, example)
    clear_image_timestamp(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z%create_int_feature_list.<locals>._hasc  r   r   c                 (    t          | |          S r   r   r   s     r   r   z*create_int_feature_list.<locals>._get_sizef  r   r   c                 *    t          | ||          S r   )rt   r   s      r   r   z(create_int_feature_list.<locals>._get_ati  s    c5"26BBBBr   c                 ,    t          | |           d S r   r   r   s     r   r   z'create_int_feature_list.<locals>._clearl  r   r   c                 .    t          | ||           d S r   )r}   r   s      r   r   z%create_int_feature_list.<locals>._addo  s!    C(888888r   c                 $    t          |           S r!   r   r   s    r   r   z)create_int_feature_list.<locals>._get_keyr  r   r   c                  V    t           j                            dt           j                  S r   )r   r   r   r   r   r   r   r   z4create_int_feature_list.<locals>._get_default_parseru  s    5((RX666r   r   r   r   r   r   r   r   r   Nr   r   s    `          r   create_int_feature_listr  O  sl   ( %+ B B B B B B *0 G G G G G G /5 C C C C C C '- = = = = = = ,2 9 9 9 9 9 9  % % % % % %7 7 7 tmTtmgytmeWovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}|ffd	}	d }
d| z   |d	| z   d
z   |d	| z   dz   |d| z   |d| z   |d	| z   dz   |	d	| z   dz   |
i}t          ||           dS )a  Creates accessor functions for list of bytes feature lists.

  The provided functions are has_${NAME}, get_${NAME}_size, get_${NAME}_at,
  clear_${NAME}, and add_${NAME}.

  example = tensorflow.train.SequenceExample()
  add_bbox_label_string(["dog", "cat"], example)
  add_bbox_label_string(["cat", "dog"], example)
  if has_bbox_label_string:
    for i in range(get_bbox_label_string_size(example):
      timestamp = get_bbox_label_string_at(i, example)
    clear_bbox_label_string(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z,create_bytes_list_feature_list.<locals>._has  r   r   c                 (    t          | |          S r   r   r   s     r   r   z1create_bytes_list_feature_list.<locals>._get_size  r   r   c                 *    t          | ||          S r   )rb   r   s      r   r   z/create_bytes_list_feature_list.<locals>._get_at      S%)9&IIIIr   c                 ,    t          | |           d S r   r   r   s     r   r   z.create_bytes_list_feature_list.<locals>._clear  r   r   c                 .    t          | ||           d S r   )rl   r   s      r   r   z,create_bytes_list_feature_list.<locals>._add  !    3/??????r   c                 $    t          |           S r!   r   r   s    r   r   z0create_bytes_list_feature_list.<locals>._get_key  r   r   c                  T    t           j                            t           j                  S r!   r   r   r   r   r   z;create_bytes_list_feature_list.<locals>._get_default_parser  r   r   r   r   r   r   r   r   r   r   Nr   r   s    `          r   create_bytes_list_feature_listr    sr   ( %+ B B B B B B *0 G G G G G G /5 J J J J J J '- = = = = = = ,2 @ @ @ @ @ @  % % % % % %* * * tmTtmgytmeWovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}|ffd	}	d }
d| z   |d	| z   d
z   |d	| z   dz   |d| z   |d| z   |d	| z   dz   |	d	| z   dz   |
i}t          ||           dS )a  Creates accessor functions for list of float feature lists.

  The provided functions are has_${NAME}, get_${NAME}_size, get_${NAME}_at,
  clear_${NAME}, and add_${NAME}.

  example = tensorflow.train.SequenceExample()
  add_bbox_ymin([0.47, 0.49], example)
  add_bbox_ymin([0.49, 0.47], example)
  if has_bbox_ymin:
    for i in range(get_bbox_ymin_size(example):
      bbox_ymin = get_bbox_ymin_at(i, example)
    clear_bbox_ymin(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z,create_float_list_feature_list.<locals>._has  r   r   c                 (    t          | |          S r   r   r   s     r   r   z1create_float_list_feature_list.<locals>._get_size  r   r   c                 *    t          | ||          S r   )r[   r   s      r   r   z/create_float_list_feature_list.<locals>._get_at  r	  r   c                 ,    t          | |           d S r   r   r   s     r   r   z.create_float_list_feature_list.<locals>._clear  r   r   c                 .    t          | ||           d S r   )rh   r   s      r   r   z,create_float_list_feature_list.<locals>._add  r  r   c                 $    t          |           S r!   r   r   s    r   r   z0create_float_list_feature_list.<locals>._get_key  r   r   c                  T    t           j                            t           j                  S r!   r   r   r   r   r   z;create_float_list_feature_list.<locals>._get_default_parser  r   r   r   r   r   r   r   r   r   r   Nr   r   s    `          r   create_float_list_feature_listr    sr   ( %+ B B B B B B *0 G G G G G G /5 J J J J J J '- = = = = = = ,2 @ @ @ @ @ @  % % % % % %+ + + tmTtmgytmeWovtmTtmfhtm'')<- -55555r   c                     |ffd	}|ffd	}|ffd	}|ffd	}|ffd	}|ffd	}	d }
d| z   |d	| z   d
z   |d	| z   dz   |d| z   |d| z   |d	| z   dz   |	d	| z   dz   |
i}t          ||           dS )a  Creates accessor functions for list of int64 feature lists.

  The provided functions are has_${NAME}, get_${NAME}_size, get_${NAME}_at,
  clear_${NAME}, and add_${NAME}.

  example = tensorflow.train.SequenceExample()
  add_bbox_label_index([47, 49], example)
  add_bbox_label_index([49, 47], example)
  if has_bbox_label_index:
    for i in range(get_bbox_label_index_size(example):
      bbox_label_index = get_bbox_label_index_at(i, example)
    clear_bbox_label_index(example)

  Args:
    name: the name of the feature to use in function names.
    key: the key for this feature in the SequenceExample.
    prefix: a prefix to append to the key in the SequenceExample
    module_dict: adds the functions to the corresponding module dict.
  c                 (    t          | |          S r   r   r   s     r   r   z*create_int_list_feature_list.<locals>._has  r   r   c                 (    t          | |          S r   r   r   s     r   r   z/create_int_list_feature_list.<locals>._get_size  r   r   c                 *    t          | ||          S r   )r_   r   s      r   r   z-create_int_list_feature_list.<locals>._get_at  s    3'7GGGGr   c                 ,    t          | |           d S r   r   r   s     r   r   z,create_int_list_feature_list.<locals>._clear  r   r   c                 .    t          | ||           d S r   )ro   r   s      r   r   z*create_int_list_feature_list.<locals>._add  s!    e-f======r   c                 $    t          |           S r!   r   r   s    r   r   z.create_int_list_feature_list.<locals>._get_key  r   r   c                  T    t           j                            t           j                  S r!   r   r   r   r   r   z9create_int_list_feature_list.<locals>._get_default_parser  r   r   r   r   r   r   r   r   r   r   Nr   r   s    `          r   create_int_list_feature_listr!    sl   ( %+ B B B B B B *0 G G G G G G /5 H H H H H H '- = = = = = = ,2 > > > > > >  % % % % % %) ) ) tmTtmgytmeWovtmTtmfhtm'')<- -55555r   r!   )r   )r   N)6__doc__
__future__r   r   r   r   tensorflow.compat.v1compatv1r   r   r   r   r&   r(   r.   r1   r5   r8   r=   r?   rA   rD   rG   rI   rK   rM   rQ   rT   rV   r[   r_   rb   rh   rl   ro   rq   rt   rv   rx   r{   r}   r   r   r   r   r   r   r   r   r  r  r  r!  r   r   r   <module>r'     s   ( ' & & & & &       % % % % % %  ! ! ! ! ! ! ! ! !7 7 7, , , ,   ? ? ? ?: : : :   
( ( ( (
3 3 3 3
Q Q Q Q3 3 3 3
Q Q Q Q0 0 0 0
N N N N0 0 0 0
N N N N0 0 0 0
N N N NJ J J J   E E E E   
   
   
! ! ! !
! ! ! !
! ! ! !
! ! ! !
! ! ! !
! ! ! !
# # # #
# # # #
# # # #
-6 -6 -6 -6`-6 -6 -6 -6`-6 -6 -6 -6`-6 -6 -6 -6`-6 -6 -6 -6`-6 -6 -6 -6`26 26 26 26j26 26 26 26j26 26 26 26j26 26 26 26j26 26 26 26j26 26 26 26 26 26r   