Commit 44a93341 authored by Diego André Sant'Ana's avatar Diego André Sant'Ana 🤞

upload dataset

parent c2e01b6c
......@@ -234,13 +234,17 @@ class CNNKeras(Classifier):
path_classes = self.weight_path.replace(
"_model.h5", "_classes.npy")
print("Load Model H5:"+self.weight_path)
np_load_old = np.load
# modify the default parameters of np.load
np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k)
CLASS_NAMES = np.load(path_classes).item().keys()
except Exception as e:
raise IException("Can't load the model in " +
self.weight_path + str(e))
str(e))
output_classification = self.model.predict_generator(
classify_generator, classify_generator.samples, verbose=2)
classify_generator)
one_hot_output = np.argmax(output_classification, axis=1)
......
......@@ -843,7 +843,7 @@ class Act(object):
if idx_segment % 10 == 0:
self.tk.write_log("Saving %d of %d", (idx_segment+1), qtd_superpixel)
segment, size_segment, idx_segment, run_time = self.segmenter.get_segment(idx_segment = idx_segment)
segment, size_segment, xml,idx_segment, run_time = self.segmenter.get_segment(idx_segment = idx_segment)
filepath = File.save_class_image(segment, self.dataset, self.classes[idx_class]["name"].value, self._image_name, idx_segment)
if filepath:
self.tk.append_log("\nSegment saved in %s", filepath)
......
......@@ -178,7 +178,7 @@ class SkimageSegmenter(object):
if SkimageSegmenter.FORCE_OPT == False:
colored_image = cv2.addWeighted(self._original_image, 0.7, class_color, 0.3, 0)
else:
colored_image = cv2.addWeighted(image, 0.7, class_color, 0.3, 0)
colored_image = cv2.addWeighted(image, 0.1, class_color, 0.9, 0)
colored_image = cv2.bitwise_and(colored_image, colored_image, mask=mask_segment)
# Create a new image keeping the painting only in pixels inside of segments
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment