- 25 Mar, 2022 1 commit
-
-
Luke Wood authored
Explicitly import estimator from tensorflow as a separate import instead of accessing it via tf.estimator and depend on the tensorflow estimator target. PiperOrigin-RevId: 437338390
-
- 09 Jul, 2020 1 commit
-
-
vivek rathod authored
320335495 by rathodv: Remove hparams support form TF1 main binaries as its not available in TF1.15 runtime on cloud ai platform. -- 320278161 by ronnyvotel: Exposing DensePose fields to model libraries. -- 320277319 by rathodv: Remove TPU Name check since TPU is automatically inferred under cloud AI platform. -- 320258215 by rathodv: Internal Change. -- 320245458 by yuhuic: Updated the CenterNet restore_from_objects function to be compatible with existing configs that load converted checkpoints. -- 320225405 by jonathanhuang: Small change to Keras box predictor and box heads to fix export errors for SSD and Faster R-CNN. -- 320145077 by aom: Implements EfficientDet feature extractor. -- PiperOrigin-RevId: 320335495 Co-authored-by:TF Object Detection Team <no-reply@google.com>
-
- 26 May, 2020 1 commit
-
-
pkulzc authored
* Merged commit includes the following changes: 311933687 by Sergio Guadarrama: Removes spurios use of tf.compat.v2, which results in spurious tf.compat.v1.compat.v2. Adds basic test to nasnet_utils. Replaces all remaining import tensorflow as tf with import tensorflow.compat.v1 as tf -- 311766063 by Sergio Guadarrama: Removes explicit tf.compat.v1 in all call sites (we already import tf.compat.v1, so this code was doing tf.compat.v1.compat.v1). The existing code worked in latest version of tensorflow, 2.2, (and 1.15) but not in 1.14 or in 2.0.0a, this CL fixes it. -- 311624958 by Sergio Guadarrama: Updates README that doesn't render properly in github documentation -- 310980959 by Sergio Guadarrama: Moves research_models/slim off tf.contrib.slim/layers/framework to tf_slim -- 310263156 by Sergio Guadarrama: Adds model breakdown for MobilenetV3 -- 308640516 by Sergio Guadarrama: Internal change 308244396 by Sergio Guadarrama: GroupNormalization support for MobilenetV3. -- 307475800 by Sergio Guadarrama: Internal change -- 302077708 by Sergio Guadarrama: Remove `disable_tf2` behavior from slim py_library targets -- 301208453 by Sergio Guadarrama: Automated refactoring to make code Python 3 compatible. -- 300816672 by Sergio Guadarrama: Internal change 299433840 by Sergio Guadarrama: Internal change 299221609 by Sergio Guadarrama: Explicitly disable Tensorflow v2 behaviors for all TF1.x binaries and tests -- 299179617 by Sergio Guadarrama: Internal change 299040784 by Sergio Guadarrama: Internal change 299036699 by Sergio Guadarrama: Internal change 298736510 by Sergio Guadarrama: Internal change 298732599 by Sergio Guadarrama: Internal change 298729507 by Sergio Guadarrama: Internal change 298253328 by Sergio Guadarrama: Internal change 297788346 by Sergio Guadarrama: Internal change 297785278 by Sergio Guadarrama: Internal change 297783127 by Sergio Guadarrama: Internal change 297725870 by Sergio Guadarrama: Internal change 297721811 by Sergio Guadarrama: Internal change 297711347 by Sergio Guadarrama: Internal change 297708059 by Sergio Guadarrama: Internal change 297701831 by Sergio Guadarrama: Internal change 297700038 by Sergio Guadarrama: Internal change 297670468 by Sergio Guadarrama: Internal change. -- 297350326 by Sergio Guadarrama: Explicitly replace "import tensorflow" with "tensorflow.compat.v1" for TF2.x migration -- 297201668 by Sergio Guadarrama: Explicitly replace "import tensorflow" with "tensorflow.compat.v1" for TF2.x migration -- 294483372 by Sergio Guadarrama: Internal change PiperOrigin-RevId: 311933687 * Merged commit includes the following changes: 312578615 by Menglong Zhu: Modify the LSTM feature extractors to be python 3 compatible. -- 311264357 by Menglong Zhu: Removes contrib.slim -- 308957207 by Menglong Zhu: Automated refactoring to make code Python 3 compatible. -- 306976470 by yongzhe: Internal change 306777559 by Menglong Zhu: Internal change -- 299232507 by lzyuan: Internal update. -- 299221735 by lzyuan: Add small epsilon on max_range for quantize_op to prevent range collapse. -- PiperOrigin-RevId: 312578615 * Merged commit includes the following changes: 310447280 by lzc: Internal changes. -- PiperOrigin-RevId: 310447280 Co-authored-by:Sergio Guadarrama <sguada@google.com> Co-authored-by:
Menglong Zhu <menglong@google.com>
-
- 10 Feb, 2019 1 commit
-
-
Zack Hsiao authored
-
- 21 Sep, 2018 1 commit
-
-
pkulzc authored
Release iNaturalist Species-trained models, refactor of evaluation, box predictor for object detection. (#5289) * Merged commit includes the following changes: 212389173 by Zhichao Lu: 1. Replace tf.boolean_mask with tf.where -- 212282646 by Zhichao Lu: 1. Fix a typo in model_builder.py and add a test to cover it. -- 212142989 by Zhichao Lu: Only resize masks in meta architecture if it has not already been resized in the input pipeline. -- 212136935 by Zhichao Lu: Choose matmul or native crop_and_resize in the model builder instead of faster r-cnn meta architecture. -- 211907984 by Zhichao Lu: Make eval input reader repeated field and update config util to handle this field. -- 211858098 by Zhichao Lu: Change the implementation of merge_boxes_with_multiple_labels. -- 211843915 by Zhichao Lu: Add Mobilenet v2 + FPN support. -- 211655076 by Zhichao Lu: Bug fix for generic keys in config overrides In generic configuration overrides, we had a duplicate entry for train_input_config and we were missing the eval_input_config and eval_config. This change also introduces testing for all config overrides. -- 211157501 by Zhichao Lu: Make the locally-modified conv defs a copy. So that it doesn't modify MobileNet conv defs globally for other code that transitively imports this package. -- 211112813 by Zhichao Lu: Refactoring visualization tools for Estimator's eval_metric_ops. This will make it easier for future models to take advantage of a single interface and mechanics. -- 211109571 by Zhichao Lu: A test decorator. -- 210747685 by Zhichao Lu: For FPN, when use_depthwise is set to true, use slightly modified mobilenet v1 config. -- 210723882 by Zhichao Lu: Integrating the losses mask into the meta architectures. When providing groundtruth, one can optionally specify annotation information (i.e. which images are labeled vs. unlabeled). For any image that is unlabeled, there is no loss accumulation. -- 210673675 by Zhichao Lu: Internal change. -- 210546590 by Zhichao Lu: Internal change. -- 210529752 by Zhichao Lu: Support batched inputs with ops.matmul_crop_and_resize. With this change the new inputs are images of shape [batch, heigh, width, depth] and boxes of shape [batch, num_boxes, 4]. The output tensor is of the shape [batch, num_boxes, crop_height, crop_width, depth]. -- 210485912 by Zhichao Lu: Fix TensorFlow version check in object_detection_tutorial.ipynb -- 210484076 by Zhichao Lu: Reduce TPU memory required for single image matmul_crop_and_resize. Using tf.einsum eliminates intermediate tensors, tiling and expansion. for an image of size [40, 40, 1024] and boxes of shape [300, 4] HBM memory usage goes down from 3.52G to 1.67G. -- 210468361 by Zhichao Lu: Remove PositiveAnchorLossCDF/NegativeAnchorLossCDF to resolve "Main thread is not in main loop error" issue in local training. -- 210100253 by Zhichao Lu: Pooling pyramid feature maps: add option to replace max pool with convolution layers. -- 209995842 by Zhichao Lu: Fix a bug which prevents variable sharing in Faster RCNN. -- 209965526 by Zhichao Lu: Add support for enabling export_to_tpu through the estimator. -- 209946440 by Zhichao Lu: Replace deprecated tf.train.Supervisor with tf.train.MonitoredSession. MonitoredSession also takes away the hassle of starting queue runners. -- 209888003 by Zhichao Lu: Implement function to handle data where source_id is not set. If the field source_id is found to be the empty string for any image during runtime, it will be replaced with a random string. This avoids hash-collisions on dataset where many examples do not have source_id set. Those hash-collisions have unintended site effects and may lead to bugs in the detection pipeline. -- 209842134 by Zhichao Lu: Converting loss mask into multiplier, rather than using it as a boolean mask (which changes tensor shape). This is necessary, since other utilities (e.g. hard example miner) require a loss matrix with the same dimensions as the original prediction tensor. -- 209768066 by Zhichao Lu: Adding ability to remove loss computation from specific images in a batch, via an optional boolean mask. -- 209722556 by Zhichao Lu: Remove dead code. (_USE_C_API was flipped to True by default in TensorFlow 1.8) -- 209701861 by Zhichao Lu: This CL cleans-up some tf.Example creation snippets, by reusing the convenient tf.train.Feature building functions in dataset_util. -- 209697893 by Zhichao Lu: Do not overwrite num_epoch for eval input. This leads to errors in some cases. -- 209694652 by Zhichao Lu: Sample boxes by jittering around the currently given boxes. -- 209550300 by Zhichao Lu: `create_category_index_from_labelmap()` function now accepts `use_display_name` parameter. Also added create_categories_from_labelmap function for convenience -- 209490273 by Zhichao Lu: Check result_dict type before accessing image_id via key. -- 209442529 by Zhichao Lu: Introducing the capability to sample examples for evaluation. This makes it easy to specify one full epoch of evaluation, or a subset (e.g. sample 1 of every N examples). -- 208941150 by Zhichao Lu: Adding the capability of exporting the results in json format. -- 208888798 by Zhichao Lu: Fixes wrong dictionary key for num_det_boxes_per_image. -- 208873549 by Zhichao Lu: Reduce the number of HLO ops created by matmul_crop_and_resize. Do not unroll along the channels dimension. Instead, transpose the input image dimensions, apply tf.matmul and transpose back. The number of HLO instructions for 1024 channels reduce from 12368 to 110. -- 208844315 by Zhichao Lu: Add an option to use tf.non_maximal_supression_padded in SSD post-process -- 208731380 by Zhichao Lu: Add field in box_predictor config to enable mask prediction and update builders accordingly. -- 208699405 by Zhichao Lu: This CL creates a keras-based multi-resolution feature map extractor. -- 208557208 by Zhichao Lu: Add TPU tests for Faster R-CNN Meta arch. * Tests that two_stage_predict and total_loss tests run successfully on TPU. * Small mods to multiclass_non_max_suppression to preserve static shapes. -- 208499278 by Zhichao Lu: This CL makes sure the Keras convolutional box predictor & head layers apply activation layers *after* normalization (as opposed to before). -- 208391694 by Zhichao Lu: Updating visualization tool to produce multiple evaluation images. -- 208275961 by Zhichao Lu: This CL adds a Keras version of the Convolutional Box Predictor, as well as more general infrastructure for making Keras Prediction heads & Keras box predictors. -- 208275585 by Zhichao Lu: This CL enables the Keras layer hyperparameter object to build a dedicated activation layer, and to disable activation by default in the op layer construction kwargs. This is necessary because in most cases the normalization layer must be applied before the activation layer. So, in Keras models we must set the convolution activation in a dedicated layer after normalization is applied, rather than setting it in the convolution layer construction args. -- 208263792 by Zhichao Lu: Add a new SSD mask meta arch that can predict masks for SSD models. Changes including: - overwrite loss function to add mask loss computation. - update ssd_meta_arch to handle masks if predicted in predict and postprocessing. -- 208000218 by Zhichao Lu: Make FasterRCNN choose static shape operations only in training mode. -- 207997797 by Zhichao Lu: Add static boolean_mask op to box_list_ops.py and use that in faster_rcnn_meta_arch.py to support use_static_shapes option. -- 207993460 by Zhichao Lu: Include FGVC detection models in model zoo. -- 207971213 by Zhichao Lu: remove the restriction to run tf.nn.top_k op on CPU -- 207961187 by Zhichao Lu: Build the first stage NMS function in the model builder and pass it to FasterRCNN meta arch. -- 207960608 by Zhichao Lu: Internal Change. -- 207927015 by Zhichao Lu: Have an option to use the TPU compatible NMS op cl/206673787, in the batch_multiclass_non_max_suppression function. On setting pad_to_max_output_size to true, the output nmsed boxes are padded to be of length max_size_per_class. This can be used in first stage Region Proposal Network in FasterRCNN model by setting the first_stage_nms_pad_to_max_proposals field to true in config proto. -- 207809668 by Zhichao Lu: Add option to use depthwise separable conv instead of conv2d in FPN and WeightSharedBoxPredictor. More specifically, there are two related configs: - SsdFeatureExtractor.use_depthwise - WeightSharedConvolutionalBoxPredictor.use_depthwise -- 207808651 by Zhichao Lu: Fix the static balanced positive negative sampler's TPU tests -- 207798658 by Zhichao Lu: Fixes a post-refactoring bug where the pre-prediction convolution layers in the convolutional box predictor are ignored. -- 207796470 by Zhichao Lu: Make slim endpoints visible in FasterRCNNMetaArch. -- 207787053 by Zhichao Lu: Refactor ssd_meta_arch so that the target assigner instance is passed into the SSDMetaArch constructor rather than constructed inside. -- PiperOrigin-RevId: 212389173 * Fix detection model zoo typo. * Modify tf example decoder to handle label maps with either `display_name` or `name` fields seamlessly. Currently, tf example decoder uses only `name` field to look up ids for class text field present in the data. This change uses both `display_name` and `name` fields in the label map to fetch ids for class text. PiperOrigin-RevId: 212672223 * Modify create_coco_tf_record tool to write out class text instead of class labels. PiperOrigin-RevId: 212679112 * Fix detection model zoo typo. PiperOrigin-RevId: 212715692 * Adding the following two optional flags to WeightSharedConvolutionalBoxHead: 1) In the box head, apply clipping to box encodings in the box head. 2) In the class head, apply sigmoid to class predictions at inference time. PiperOrigin-RevId: 212723242 * Support class confidences in merge boxes with multiple labels. PiperOrigin-RevId: 212884998 * Creates multiple eval specs for object detection. PiperOrigin-RevId: 212894556 * Set batch_norm on last layer in Mask Head to None. PiperOrigin-RevId: 213030087 * Enable bfloat16 training for object detection models. PiperOrigin-RevId: 213053547 * Skip padding op when unnecessary. PiperOrigin-RevId: 213065869 * Modify `Matchers` to use groundtruth weights before performing matching. Groundtruth weights tensor is used to indicate padding in groundtruth box tensor. It is handled in `TargetAssigner` by creating appropriate classification and regression target weights based on the groundtruth box each anchor matches to. However, options such as `force_match_all_rows` in `ArgmaxMatcher` force certain anchors to match to groundtruth boxes that are just paddings thereby reducing the number of anchors that could otherwise match to real groundtruth boxes. For single stage models like SSD the effect of this is negligible as there are two orders of magnitude more anchors than the number of padded groundtruth boxes. But for Faster R-CNN and Mask R-CNN where there are only 300 anchors in the second stage, a significant number of these match to groundtruth paddings reducing the number of anchors regressing to real groundtruth boxes degrading the performance severely. Therefore, this change introduces an additional boolean argument `valid_rows` to `Matcher.match` methods and the implementations now ignore such padded groudtruth boxes during matching. PiperOrigin-RevId: 213345395 * Add release note for iNaturalist Species trained models. PiperOrigin-RevId: 213347179 * Fix the bug of uninitialized gt_is_crowd_list variable. PiperOrigin-RevId: 213364858 * ...text exposed to open source public git repo... PiperOrigin-RevId: 213554260
-
- 02 Jul, 2018 1 commit
-
-
pkulzc authored
* Merged commit includes the following changes: 202804536 by Zhichao Lu: Return tf.data.Dataset from input_fn that goes into the estimator and use PER_HOST_V2 option for tpu input pipeline config. This change shaves off 100ms per step resulting in 25 minutes of total reduced training time for ssd mobilenet v1 (15k steps to convergence). -- 202769340 by Zhichao Lu: Adding as_matrix() transformation for image-level labels. -- 202768721 by Zhichao Lu: Challenge evaluation protocol modification: adding labelmaps creation. -- 202750966 by Zhichao Lu: Add the explicit names to two output nodes. -- 202732783 by Zhichao Lu: Enforcing that batch size is 1 for evaluation, and no original images are retained during evaluation when use_tpu=False (to avoid dynamic shapes). -- 202425430 by Zhichao Lu: Refactor input pipeline to improve performance. -- 202406389 by Zhichao Lu: Only check the validity of `warmup_learning_rate` if it will be used. -- 202330450 by Zhichao Lu: Adding the description of the flag input_image_label_annotations_csv to add image-level labels to tf.Example. -- 202029012 by Zhichao Lu: Enabling displaying relationship name in the final metrics output. -- 202024010 by Zhichao Lu: Update to the public README. -- 201999677 by Zhichao Lu: Fixing the way negative labels are handled in VRD evaluation. -- 201962313 by Zhichao Lu: Fix a bug in resize_to_range. -- 201808488 by Zhichao Lu: Update ssd_inception_v2_pets.config to use right filename of pets dataset tf records. -- 201779225 by Zhichao Lu: Update object detection API installation doc -- 201766518 by Zhichao Lu: Add shell script to create pycocotools package for CMLE. -- 201722377 by Zhichao Lu: Removes verified_labels field and uses groundtruth_image_classes field instead. -- 201616819 by Zhichao Lu: Disable eval_on_tpu since eval_metrics is not setup to execute on TPU. Do not use run_config.task_type to switch tpu mode for EVAL, since that won't work in unit test. Expand unit test to verify that the same instantiation of the Estimator can independently disable eval on TPU whereas training is enabled on TPU. -- 201524716 by Zhichao Lu: Disable export model to TPU, inference is not compatible with TPU. Add GOOGLE_INTERNAL support in object detection copy.bara.sky -- 201453347 by Zhichao Lu: Fixing bug when evaluating the quantized model. -- 200795826 by Zhichao Lu: Fixing parsing bug: image-level labels are parsed as tuples instead of numpy array. -- 200746134 by Zhichao Lu: Adding image_class_text and image_class_label fields into tf_example_decoder.py -- 200743003 by Zhichao Lu: Changes to model_main.py and model_tpu_main to enable training and continuous eval. -- 200736324 by Zhichao Lu: Replace deprecated squeeze_dims argument. -- 200730072 by Zhichao Lu: Make detections only during predict and eval mode while creating model function -- 200729699 by Zhichao Lu: Minor correction to internal documentation (definition of Huber loss) -- 200727142 by Zhichao Lu: Add command line parsing as a set of flags using argparse and add header to the resulting file. -- 200726169 by Zhichao Lu: A tutorial on running evaluation for the Open Images Challenge 2018. -- 200665093 by Zhichao Lu: Cleanup on variables_helper_test.py. -- 200652145 by Zhichao Lu: Add an option to write (non-frozen) graph when exporting inference graph. -- 200573810 by Zhichao Lu: Update ssd_mobilenet_v1_coco and ssd_inception_v2_coco download links to point to a newer version. -- 200498014 by Zhichao Lu: Add test for groundtruth mask resizing. -- 200453245 by Zhichao Lu: Cleaning up exporting_models.md along with exporting scripts -- 200311747 by Zhichao Lu: Resize groundtruth mask to match the size of the original image. -- 200287269 by Zhichao Lu: Having a option to use custom MatMul based crop_and_resize op as an alternate to the TF op in Faster-RCNN -- 200127859 by Zhichao Lu: Updating the instructions to run locally with new binary. Also updating pets configs since file path naming has changed. -- 200127044 by Zhichao Lu: A simpler evaluation util to compute Open Images Challenge 2018 metric (object detection track). -- 200124019 by Zhichao Lu: Freshening up configuring_jobs.md -- 200086825 by Zhichao Lu: Make merge_multiple_label_boxes work for ssd model. -- 199843258 by Zhichao Lu: Allows inconsistent feature channels to be compatible with WeightSharedConvolutionalBoxPredictor. -- 199676082 by Zhichao Lu: Enable an override for `InputReader.shuffle` for object detection pipelines. -- 199599212 by Zhichao Lu: Markdown fixes. -- 199535432 by Zhichao Lu: Pass num_additional_channels to tf.example decoder in predict_input_fn. -- 199399439 by Zhichao Lu: Adding `num_additional_channels` field to specify how many additional channels to use in the model. -- PiperOrigin-RevId: 202804536 * Add original model builder and docs back.
-
- 01 May, 2018 1 commit
-
-
pkulzc authored
* Adding option for one_box_for_all_classes to the box_predictor PiperOrigin-RevId: 192813444 * Extend to accept different ratios of conv channels. PiperOrigin-RevId: 192837477 * Remove inaccurate caveat from proto file. PiperOrigin-RevId: 192850747 * Add option to set dropout for classification net in weight shared box predictor. PiperOrigin-RevId: 192922089 * fix flakiness in testSSDRandomCropWithMultiClassScores due to randomness. PiperOrigin-RevId: 193067658 * Post-process now works again in train mode. PiperOrigin-RevId: 193087707 * Adding support for reading in logits as groundtruth labels and applying an optional temperature (scaling) before softmax in support of distillation. PiperOrigin-RevId: 193119411 * Add a util function to visualize value histogram as a tf.summary.image. PiperOrigin-RevId: 193137342 * Do not add batch norm parameters to final conv2d ops that predict boxes encodings and class scores in weight shared conv box predictor. This allows us to set proper bias and force initial predictions to be background when using focal loss. PiperOrigin-RevId: 193204364 * Make sure the final layers are also resized proportional to conv_depth_ratio. PiperOrigin-RevId: 193228972 * Remove deprecated batch_norm_trainable field from ssd mobilenet v2 config PiperOrigin-RevId: 193244778 * Updating coco evaluation metrics to allow for a batch of image info, rather than a single image. PiperOrigin-RevId: 193382651 * Update protobuf requirements to 3+ in installation docs. PiperOrigin-RevId: 193409179 * Add support for training keypoints. PiperOrigin-RevId: 193576336 * Fix data augmentation functions. PiperOrigin-RevId: 193737238 * Read the default batch size from config file. PiperOrigin-RevId: 193959861 * Fixing a bug in the coco evaluator. PiperOrigin-RevId: 193974479 * num_gt_boxes_per_image and num_det_boxes_per_image value incorrect. Should be not the expand dim. PiperOrigin-RevId: 194122420 * Add option to evaluate any checkpoint (without requiring write access to that directory and overwriting any existing logs there). PiperOrigin-RevId: 194292198 * PiperOrigin-RevId: 190346687 * - Expose slim arg_scope function to compute keys to enable tessting. - Add is_training=None option to mobinenet arg_scopes. This allows the users to set is_training from an outer scope. PiperOrigin-RevId: 190997959 * Add an option to not set slim arg_scope for batch_norm is_training parameter. This enables users to set the is_training parameter from an outer scope. PiperOrigin-RevId: 191611934 * PiperOrigin-RevId: 191955231 * PiperOrigin-RevId: 193254125 * PiperOrigin-RevId: 193371562 * PiperOrigin-RevId: 194085628
-
- 16 Apr, 2018 1 commit
-
-
pkulzc authored
-
- 13 Apr, 2018 2 commits
-
-
Zhichao Lu authored
Returning eval_on_train_input_fn from create_estimator_and_inputs(), rather than using train_input_fn in EVAL mode (which will still have data augmentation). PiperOrigin-RevId: 192320460
-
Zhichao Lu authored
Migrating away from Experiment class, as it is now deprecated. Also, refactoring into a separate model library and binaries. PiperOrigin-RevId: 192004845
-