c28a63fa9d9fb9ba3cced7052ea243e8884f9bf1,tensorflow_datasets/image/deep_weeds.py,DeepWeeds,_generate_examples,#DeepWeeds#Any#Any#,123
Before Change
def _generate_examples(self, data_dir_path, label_dir_path):
Generate images and labels for splits.
// parse the csv-label data
csv = np.loadtxt(label_dir_path,
dtype={"names": ("Filename", "Label", "Species"), "formats": ("S21", "i4", "S1")},
skiprows=1,
delimiter=",")
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)
label = _NAMES[label_dict[file_name]]
yield file_name, {"image": image, "label": label}
After Change
// 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
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
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: dgasmith/opt_einsum
Commit Name: 43e740fa6ea915e7143b9e58a231042d22ab5587
Time: 2018-08-09
Author: john.gray.14@ucl.ac.uk
File Name: opt_einsum/contract.py
Class Name:
Method Name: contract_path
Project Name: hellohaptik/chatbot_ner
Commit Name: 34f14dac8d65ffd6210a87a610afad1593d47294
Time: 2019-06-18
Author: jain.chirag925@gmail.com
File Name: ner_v1/detectors/numeral/budget/budget_detection.py
Class Name: BudgetDetector
Method Name: __init__
Project Name: senarvi/theanolm
Commit Name: bcf723a2f67a372e6b03a453149a82ecf2766fff
Time: 2015-12-24
Author: seppo.git@marjaniemi.com
File Name: theanolm/network.py
Class Name: Architecture
Method Name: from_state