- 30 Nov, 2018 1 commit
-
-
Zhichao Lu authored
223075771 by lzc: Bring in external fixes. -- 222919755 by ronnyvotel: Bug fix in faster r-cnn model builder. Was previously using `inplace_batchnorm_update` for `reuse_weights`. -- 222885680 by Zhichao Lu: Use the result_dict_for_batched_example in models_lib Also fixes the visualization size on when eval is on GPU -- 222883648 by Zhichao Lu: Fix _unmatched_class_label for the _add_background_class == False case in ssd_meta_arch.py. -- 222836663 by Zhichao Lu: Adding support for visualizing grayscale images. Without this change, the images are black-red instead of grayscale. -- 222501978 by Zhichao Lu: Fix a bug that caused convert_to_grayscale flag not to be respected. -- 222432846 by richardmunoz: Fix mapping of groundtruth_confidences from shape [num_boxes] to [num_boxes, num_classes] when the input contains the groundtruth_confidences field. -- 221725755 by richardmunoz: Internal change. -- 221458536 by Zhichao Lu: Fix saver defer build bug in object detection train codepath. -- 221391590 by Zhichao Lu: Add support for group normalization in the object detection API. Just adding MobileNet-v1 SSD currently. This may serve as a road map for other models that wish to support group normalization as an option. -- 221367993 by Zhichao Lu: Bug fixes (1) Make RandomPadImage work, (2) Fix keep_checkpoint_every_n_hours. -- 221266403 by rathodv: Use detection boxes as proposals to compute correct mask loss in eval jobs. -- 220845934 by lzc: Internal change. -- 220778850 by Zhichao Lu: Incorporating existing metrics into Estimator framework. Should restore: -oid_challenge_detection_metrics -pascal_voc_detection_metrics -weighted_pascal_voc_detection_metrics -pascal_voc_instance_segmentation_metrics -weighted_pascal_voc_instance_segmentation_metrics -oid_V2_detection_metrics -- 220370391 by alirezafathi: Adding precision and recall to the metrics. -- 220321268 by Zhichao Lu: Allow the option of setting max_examples_to_draw to zero. -- 220193337 by Zhichao Lu: This CL fixes a bug where the Keras convolutional box predictor was applying heads in the non-deterministic dict order. The consequence of this bug was that variables were created in non-deterministic orders. This in turn led different workers in a multi-gpu training setup to have slightly different graphs which had variables assigned to mismatched parameter servers. As a result, roughly half of all workers were unable to initialize and did no work, and training time was slowed down approximately 2x. -- 220136508 by huizhongc: Add weight equalization loss to SSD meta arch. -- 220125875 by pengchong: Rename label_scores to label_weights -- 219730108 by Zhichao Lu: Add description of detection_keypoints in postprocessed_tensors to docstring. -- 219577519 by pengchong: Support parsing the class confidences and training using them. -- 219547611 by lzc: Stop using static shapes in GPU eval jobs. -- 219536476 by Zhichao Lu: Migrate TensorFlow Lite out of tensorflow/contrib This change moves //tensorflow/contrib/lite to //tensorflow/lite in preparation for TensorFlow 2.0's deprecation of contrib/. If you refer to TF Lite build targets or headers, you will need to update them manually. If you use TF Lite from the TensorFlow python package, "tf.contrib.lite" now points to "tf.lite". Please update your imports as soon as possible. For more details, see https://groups.google.com/a/tensorflow.org/forum/#!topic/tflite/iIIXOTOFvwQ @angersson and @aselle are conducting this migration. Please contact them if you have any further questions. -- 219190083 by Zhichao Lu: Add a second expected_loss_weights function using an alternative expectation calculation compared to previous. Integrate this op into ssd_meta_arch and losses builder. Affects files that use losses_builder.build to handle the returning of an additional element. -- 218924451 by pengchong: Add a new way to assign training targets using groundtruth confidences. -- 218760524 by chowdhery: Modify export script to add option for regular NMS in TFLite post-processing op. -- PiperOrigin-RevId: 223075771
-
- 02 Nov, 2018 1 commit
-
-
pkulzc authored
* Internal change. PiperOrigin-RevId: 213914693 * Add original_image_spatial_shape tensor in input dictionary to store shape of the original input image PiperOrigin-RevId: 214018767 * Remove "groundtruth_confidences" from decoders use "groundtruth_weights" to indicate label confidence. This also solves a bug that only surfaced now - random crop routines in core/preprocessor.py did not correctly handle "groundtruth_weight" tensors returned by the decoders. PiperOrigin-RevId: 214091843 * Update CocoMaskEvaluator to allow for a batch of image info, rather than a single image. PiperOrigin-RevId: 214295305 * Adding the option to be able to summarize gradients. PiperOrigin-RevId: 214310875 * Adds FasterRCNN inference on CPU 1. Adds a flag use_static_shapes_for_eval to restrict to the ops that guarantees static shape. 2. No filtering of overlapping anchors while clipping the anchors when use_static_shapes_for_eval is set to True. 3. Adds test for faster_rcnn_meta_arch for predict and postprocess in inference mode for first and second stages. PiperOrigin-RevId: 214329565 * Fix model_lib eval_spec_names assignment (integer->string). PiperOrigin-RevId: 214335461 * Refactor Mask HEAD to optionally upsample after applying convolutions on ROI crops. PiperOrigin-RevId: 214338440 * Uses final_exporter_name as exporter_name for the first eval spec for backward compatibility. PiperOrigin-RevId: 214522032 * Add reshaped `mask_predictions` tensor to the prediction dictionary in `_predict_third_stage` method to allow computing mask loss in eval job. PiperOrigin-RevId: 214620716 * Add support for fully conv training to fpn. PiperOrigin-RevId: 214626274 * Fix the proprocess() function in Resnet v1 to make it work for any number of input channels. Note: If the #channels != 3, this will simply skip the mean subtraction in preprocess() function. PiperOrigin-RevId: 214635428 * Wrap result_dict_for_single_example in eval_util to run for batched examples. PiperOrigin-RevId: 214678514 * Adds PNASNet-based (ImageNet model) feature extractor for SSD. PiperOrigin-RevId: 214988331 * Update documentation PiperOrigin-RevId: 215243502 * Correct index used to compute number of groundtruth/detection boxes in COCOMaskEvaluator. Due to an incorrect indexing in cl/214295305 only the first detection mask and first groundtruth mask for a given image are fed to the COCO Mask evaluation library. Since groundtruth masks are arranged in no particular order, the first and highest scoring detection mask (detection masks are ordered by score) won't match the the first and only groundtruth retained in all cases. This is I think why mask evaluation metrics do not get better than ~11 mAP. Note that this code path is only active when using model_main.py binary for evaluation. This change fixes the indices and modifies an existing test case to cover it. PiperOrigin-RevId: 215275936 * Fixing grayscale_image_resizer to accept mask as input. PiperOrigin-RevId: 215345836 * Add an option not to clip groundtruth boxes during preprocessing. Clipping boxes adversely affects training for partially occluded or large objects, especially for fully conv models. Clipping already occurs during postprocessing, and should not occur during training. PiperOrigin-RevId: 215613379 * Always return recalls and precisions with length equal to the number of classes. The previous behavior of ObjectDetectionEvaluation was somewhat dangerous: when no groundtruth boxes were present, the lists of per-class precisions and recalls were simply truncated. Unless you were aware of this phenomenon (and consulted the `num_gt_instances_per_class` vector) it was difficult to associate each metric with each class. PiperOrigin-RevId: 215633711 * Expose the box feature node in SSD. PiperOrigin-RevId: 215653316 * Fix ssd mobilenet v2 _CONV_DEFS overwriting issue. PiperOrigin-RevId: 215654160 * More documentation updates PiperOrigin-RevId: 215656580 * Add pooling + residual option in multi_resolution_feature_maps. It adds an average pooling and a residual layer between feature maps with matching depth. Designed to be used with WeightSharedBoxPredictor. PiperOrigin-RevId: 215665619 * Only call create_modificed_mobilenet_config on init if use_depthwise is true. PiperOrigin-RevId: 215784290 * Only call create_modificed_mobilenet_config on init if use_depthwise is true. PiperOrigin-RevId: 215837524 * Don't prune keypoints if clip_boxes is false. PiperOrigin-RevId: 216187642 * Makes sure "key" field exists in the result dictionary. PiperOrigin-RevId: 216456543 * Add add_background_class parameter to allow disabling the inclusion of a background class. PiperOrigin-RevId: 216567612 * Update expected_classification_loss_under_sampling to better account for expected sampling. PiperOrigin-RevId: 216712287 * Let the evaluation receive a evaluation class in its constructor. PiperOrigin-RevId: 216769374 * This CL adds model building & training support for end-to-end Keras-based SSD models. If a Keras feature extractor's name is specified in the model config (e.g. 'ssd_mobilenet_v2_keras'), the model will use that feature extractor and a corresponding Keras-based box predictor. This CL makes sure regularization losses & batch norm updates work correctly when training models that have Keras-based components. It also updates the default hyperparameter settings of the keras-based mobilenetV2 (when not overriding hyperparams) to more closely match the legacy Slim training scope. PiperOrigin-RevId: 216938707 * Adding the ability in the coco evaluator to indicate whether an image has been annotated. For a non-annotated image, detections and groundtruth are not supplied. PiperOrigin-RevId: 217316342 * Release the 8k minival dataset ids for MSCOCO, used in Huang et al. "Speed/accuracy trade-offs for modern convolutional object detectors" (https://arxiv.org/abs/1611.10012) PiperOrigin-RevId: 217549353 * Exposes weighted_sigmoid_focal loss for faster rcnn classifier PiperOrigin-RevId: 217601740 * Add detection_features to output nodes. The shape of the feature is [batch_size, max_detections, depth]. PiperOrigin-RevId: 217629905 * FPN uses a custom NN resize op for TPU-compatibility. Replace this op with the Tensorflow version at export time for TFLite-compatibility. PiperOrigin-RevId: 217721184 * Compute `num_groundtruth_boxes` in inputs.tranform_input_data_fn after data augmentation instead of decoders. PiperOrigin-RevId: 217733432 * 1. Stop gradients from flowing into groundtruth masks with zero paddings. 2. Normalize pixelwise cross entropy loss across the whole batch. PiperOrigin-RevId: 217735114 * Optimize Input pipeline for Mask R-CNN on TPU with blfoat16: improve the step time from: 1663.6 ms -> 1184.2 ms, about 28.8% improvement. PiperOrigin-RevId: 217748833 * Fixes to export a TPU compatible model Adds nodes to each of the output tensor. Also increments the value of class labels by 1. PiperOrigin-RevId: 217856760 * API changes: - change the interface of target assigner to return per-class weights. - change the interface of classification loss to take per-class weights. PiperOrigin-RevId: 217968393 * Add an option to override pipeline config in export_saved_model using command line arg PiperOrigin-RevId: 218429292 * Include Quantized trained MobileNet V2 SSD and FaceSsd in model zoo. PiperOrigin-RevId: 218530947 * Write final config to disk in `train` mode only. PiperOrigin-RevId: 218735512
-
- 08 Aug, 2018 1 commit
-
-
pkulzc authored
* Merged commit includes the following changes: 207771702 by Zhichao Lu: Refactoring evaluation utilities so that it is easier to introduce new DetectionEvaluators with eval_metric_ops. -- 207758641 by Zhichao Lu: Require tensorflow version 1.9+ for running object detection API. -- 207641470 by Zhichao Lu: Clip `num_groundtruth_boxes` in pad_input_data_to_static_shapes() to `max_num_boxes`. This prevents a scenario where tensors are sliced to an invalid range in model_lib.unstack_batch(). -- 207621728 by Zhichao Lu: This CL adds a FreezableBatchNorm that inherits from the Keras BatchNormalization layer, but supports freezing the `training` parameter at construction time instead of having to do it in the `call` method. It also adds a method to the `KerasLayerHyperparams` class that will build an appropriate FreezableBatchNorm layer according to the hyperparameter configuration. If batch_norm is disabled, this method returns and Identity layer. These will be used to simplify the conversion to Keras APIs. -- 207610524 by Zhichao Lu: Update anchor generators and box predictors for python3 compatibility. -- 207585122 by Zhichao Lu: Refactoring convolutional box predictor into separate prediction heads. -- 207549305 by Zhichao Lu: Pass all 1s for batch weights if nothing is specified in GT. -- 207336575 by Zhichao Lu: Move the new argument 'target_assigner_instance' to the end of the list of arguments to the ssd_meta_arch constructor for backwards compatibility. -- 207327862 by Zhichao Lu: Enable support for float output in quantized custom op for postprocessing in SSD Mobilenet model. -- 207323154 by Zhichao Lu: Bug fix: change dict.iteritems() to dict.items() -- 207301109 by Zhichao Lu: Integrating expected_classification_loss_under_sampling op as an option in the ssd_meta_arch -- 207286221 by Zhichao Lu: Adding an option to weight regression loss with foreground scores from the ground truth labels. -- 207231739 by Zhichao Lu: Explicitly mentioning the argument names when calling the batch target assigner. -- 207206356 by Zhichao Lu: Add include_trainable_variables field to train config to better handle trainable variables. -- 207135930 by Zhichao Lu: Internal change. -- 206862541 by Zhichao Lu: Do not unpad the outputs from batch_non_max_suppression before sampling. Since BalancedPositiveNegativeSampler takes an indicator for valid positions to sample from we can pass the output from NMS directly into Sampler. -- PiperOrigin-RevId: 207771702 * Remove unused doc.
-
- 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.
-
- 22 Mar, 2018 1 commit
-
-
pkulzc authored
* Force cast of num_classes to integer PiperOrigin-RevId: 188335318 * Updating config util to allow overwriting of cosine decay learning rates. PiperOrigin-RevId: 188338852 * Make box_list_ops.py and box_list_ops_test.py work with C API enabled. The C API has improved shape inference over the original Python code. This causes some previously-working conds to fail. Switching to smart_cond fixes this. Another effect of the improved shape inference is that one of the failures tested gets caught earlier, so I modified the test to reflect this. PiperOrigin-RevId: 188409792 * Fix parallel event file writing issue. Without this change, the event files might get corrupted when multiple evaluations are run in parallel. PiperOrigin-RevId: 188502560 * Deprecating the boolean flag of from_detection_checkpoint. Replace with a string field fine_tune_checkpoint_type to train_config to provide extensibility. The fine_tune_checkpoint_type can currently take value of `detection`, `classification`, or others when the restore_map is overwritten. PiperOrigin-RevId: 188518685 * Automated g4 rollback of changelist 188502560 PiperOrigin-RevId: 188519969 * Introducing eval metrics specs for Coco Mask metrics. This allows metrics to be computed in tensorflow using the tf.learn Estimator. PiperOrigin-RevId: 188528485 * Minor fix to make object_detection/metrics/coco_evaluation.py python3 compatible. PiperOrigin-RevId: 188550683 * Updating eval_util to handle eval_metric_ops from multiple `DetectionEvaluator`s. PiperOrigin-RevId: 188560474 * Allow tensor input for new_height and new_width for resize_image. PiperOrigin-RevId: 188561908 * Fix typo in fine_tune_checkpoint_type name in trainer. PiperOrigin-RevId: 188799033 * Adding mobilenet feature extractor to object detection. PiperOrigin-RevId: 188916897 * Allow label maps to optionally contain an explicit background class with id zero. PiperOrigin-RevId: 188951089 * Fix boundary conditions in random_pad_to_aspect_ratio to ensure that min_scale is always less than max_scale. PiperOrigin-RevId: 189026868 * Fallback on from_detection_checkpoint option if fine_tune_checkpoint_type isn't set. PiperOrigin-RevId: 189052833 * Add proper names for learning rate schedules so we don't see cryptic names on tensorboard. PiperOrigin-RevId: 189069837 * Enforcing that all datasets are batched (and then unbatched in the model) with batch_size >= 1. PiperOrigin-RevId: 189117178 * Adding regularization to total loss returned from DetectionModel.loss(). PiperOrigin-RevId: 189189123 * Standardize the names of loss scalars (for SSD, Faster R-CNN and R-FCN) in both training and eval so they can be compared on tensorboard. Log localization and classification losses in evaluation. PiperOrigin-RevId: 189189940 * Remove negative test from box list ops test. PiperOrigin-RevId: 189229327 * Add an option to warmup learning rate in manual stepping schedule. PiperOrigin-RevId: 189361039 * Replace tf.contrib.slim.tfexample_decoder.LookupTensor with object_detection.data_decoders.tf_example_decoder.LookupTensor. PiperOrigin-RevId: 189388556 * Force regularization summary variables under specific family names. PiperOrigin-RevId: 189393190 * Automated g4 rollback of changelist 188619139 PiperOrigin-RevId: 189396001 * Remove step 0 schedule since we do a hard check for it after cl/189361039 PiperOrigin-RevId: 189396697 * PiperOrigin-RevId: 189040463 * PiperOrigin-RevId: 189059229 * PiperOrigin-RevId: 189214402 * Force regularization summary variables under specific family names. PiperOrigin-RevId: 189393190 * Automated g4 rollback of changelist 188619139 PiperOrigin-RevId: 189396001 * Make slim python3 compatible. * Monir fixes. * Add TargetAssignment summaries in a separate family. PiperOrigin-RevId: 189407487 * 1. Setting `family` keyword arg prepends the summary names twice with the same name. Directly adding family suffix to the name gets rid of this problem. 2. Make sure the eval losses have the same name. PiperOrigin-RevId: 189434618 * Minor fixes to make object detection tf 1.4 compatible. PiperOrigin-RevId: 189437519 * Call the base of mobilenet_v1 feature extractor under the right arg scope and set batchnorm is_training based on the value passed in the constructor. PiperOrigin-RevId: 189460890 * Automated g4 rollback of changelist 188409792 PiperOrigin-RevId: 189463882 * Update object detection syncing. PiperOrigin-RevId: 189601955 * Add an option to warmup learning rate, hold it constant for a certain number of steps and cosine decay it. PiperOrigin-RevId: 189606169 * Let the proposal feature extractor function in faster_rcnn meta architectures return the activations (end_points). PiperOrigin-RevId: 189619301 * Fixed bug which caused masks to be mostly zeros (caused by detection_boxes being in absolute coordinates if scale_to_absolute=True. PiperOrigin-RevId: 189641294 * Open sourcing Mobilenetv2 + SSDLite. PiperOrigin-RevId: 189654520 * Remove unused files.
-