c28a63fa9d9fb9ba3cced7052ea243e8884f9bf1,tensorflow_datasets/image/deep_weeds.py,DeepWeeds,_generate_examples,#DeepWeeds#Any#Any#,123
Before Change
label_dict = {}
for entry in csv:
label_dict[entry[0].decode("UTF-8")] = int(entry[1] )
for file_name in tf.io.gfile.listdir(data_dir_path):
image = os.path.join(data_dir_path, file_name)
After Change
def _generate_examples(self, data_dir_path, label_path):
Generate images and labels for splits.
with tf.io.gfile.GFile(label_path) as f:
reader = csv.DictReader(f)
// Extract the mapping int -> str and save the label name string to the feature
label_id_to_name = {
row["Label"]: row["Species"] for row in reader
}
self.info.features["label"].names = [v for k, v in sorted(label_id_to_name.items())]
filename_to_label = {
row["Filename"]: row["Species"] for row in reader
}
for file_name in tf.io.gfile.listdir(data_dir_path):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: tensorflow/datasets
Commit Name: c28a63fa9d9fb9ba3cced7052ea243e8884f9bf1
Time: 2019-11-21
Author: supertux90@googlemail.com
File Name: tensorflow_datasets/image/deep_weeds.py
Class Name: DeepWeeds
Method Name: _generate_examples
Project Name: tensorflow/datasets
Commit Name: 147ebde5c074d2cc25cbab8d0435abc056877fc5
Time: 2019-02-04
Author: pierrot@google.com
File Name: tensorflow_datasets/image/cifar.py
Class Name: Cifar10
Method Name: _split_generators
Project Name: tensorflow/models
Commit Name: aee49bbd14fcc1cb8e62e723f691834a55f0045b
Time: 2019-08-01
Author: saberkun@users.noreply.github.com
File Name: official/bert/benchmark/bert_squad_benchmark.py
Class Name: BertSquadAccuracy
Method Name: _run_and_report_benchmark