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])

After Change


      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):
      yield file_name, {
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: scikit-optimize/scikit-optimize
Commit Name: 9cdd21160f4b4352b05f7b7ce9f0f63506c585c9
Time: 2017-04-17
Author: iaroslav-ai@users.noreply.github.com
File Name: benchmarks/bench_ml.py
Class Name:
Method Name: load_data_target


Project Name: matplotlib/matplotlib
Commit Name: ac731191e6a2955014b2ac9b7f7e3ddac8d92ee9
Time: 2018-12-29
Author: anntzer.lee@gmail.com
File Name: examples/misc/load_converter.py
Class Name:
Method Name: