Meehai commited on
Commit
e671706
·
1 Parent(s): 9d24ed5

2 new videos and commands

Browse files
raw_data/videos/new_videos/norawy2_DJI_0741_540p.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63467788015506f0f849f223a8aaae607caae97cfbf97bf143f1d71a5ed4d76e
3
+ size 189178876
raw_data/videos/new_videos/politehnica_DJI_0708_540p.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44f9c14638bbb2d0037b0a4cefc5e62762bb4f017fcd789a45ddbd668cca81b4
3
+ size 30453475
scripts/semantic_mapper/semantic_mapper.py CHANGED
@@ -278,6 +278,24 @@ class BuildingsFromM2FDepth(BinaryMapper, NpIORepresentation):
278
  buildings_depth = buildings * (depth[..., 0] <= thr)
279
  return self.disk_to_memory_fmt(buildings_depth.astype(bool))
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  class SafeLandingAreas(BinaryMapper, NpIORepresentation):
282
  def __init__(self, name: str, depth: DepthRepresentation, camera_normals: NormalsRepresentation,
283
  include_semantics: bool, original_classes: tuple[list[str], list[str]] | None = None,
@@ -437,9 +455,14 @@ def get_new_semantic_mapped_tasks(tasks_subset: list[str] | None = None) -> dict
437
  ]
438
 
439
  available_tasks: list[TaskMapper] = [
440
- SemanticMask2FormerMapillaryConvertedPaper("semantic_mask2former_swin_mapillary_converted", [m2f_mapillary]),
441
- SemanticMask2FormerMapillaryConvertedPaper("semantic_mask2former_r50_mapillary_converted", [m2f_r50_mapillary]),
442
- SemanticMask2FormerCOCOConverted("semantic_mask2former_swin_coco_converted", [m2f_coco]),
 
 
 
 
 
443
  buildings := BinaryMapper("buildings", [m2f_mapillary, m2f_coco, m2f_r50_mapillary],
444
  buildings_mapping, mode="majority"),
445
  BinaryMapper("sky-and-water", [m2f_mapillary, m2f_coco, m2f_r50_mapillary],
 
278
  buildings_depth = buildings * (depth[..., 0] <= thr)
279
  return self.disk_to_memory_fmt(buildings_depth.astype(bool))
280
 
281
+ class SemanticMedian(TaskMapper, NpIORepresentation):
282
+ def __init__(self, name: str, deps: list[TaskMapper]):
283
+ assert all(dep.n_channels == deps[0].n_channels for dep in deps), [(dep.name, dep.n_channels) for dep in deps]
284
+ TaskMapper.__init__(self, name, n_channels=deps[0].n_channels, dependencies=deps)
285
+ NpIORepresentation.__init__(self)
286
+ self.classes = list(deps[0].classes)
287
+ self.n_classes = len(self.classes)
288
+ self.output_dtype = "uint8"
289
+ self.color_map = deps[0].color_map
290
+
291
+ @overrides
292
+ def merge_fn(self, dep_data: list[MemoryData]) -> MemoryData:
293
+ return MemoryData(np.eye(self.n_classes)[sum(dep_data).argmax(-1)].astype(np.uint8))
294
+
295
+ @overrides
296
+ def make_images(self) -> np.ndarray:
297
+ return colorize_semantic_segmentation(self.data.output.argmax(-1), self.classes, self.color_map)
298
+
299
  class SafeLandingAreas(BinaryMapper, NpIORepresentation):
300
  def __init__(self, name: str, depth: DepthRepresentation, camera_normals: NormalsRepresentation,
301
  include_semantics: bool, original_classes: tuple[list[str], list[str]] | None = None,
 
455
  ]
456
 
457
  available_tasks: list[TaskMapper] = [
458
+ m2f_swin_mapillary_converted := SemanticMask2FormerMapillaryConvertedPaper(
459
+ "semantic_mask2former_swin_mapillary_converted", [m2f_mapillary]),
460
+ m2f_r50_mapillary_converted := SemanticMask2FormerMapillaryConvertedPaper(
461
+ "semantic_mask2former_r50_mapillary_converted", [m2f_r50_mapillary]),
462
+ m2f_swin_coco_converted := SemanticMask2FormerCOCOConverted(
463
+ "semantic_mask2former_swin_coco_converted", [m2f_coco]),
464
+ SemanticMedian("semantic_median_expert", [m2f_swin_mapillary_converted, m2f_r50_mapillary_converted,
465
+ m2f_swin_coco_converted]),
466
  buildings := BinaryMapper("buildings", [m2f_mapillary, m2f_coco, m2f_r50_mapillary],
467
  buildings_mapping, mode="majority"),
468
  BinaryMapper("sky-and-water", [m2f_mapillary, m2f_coco, m2f_r50_mapillary],
vre_dronescapes/commands.txt CHANGED
@@ -40,3 +40,12 @@ python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_fil
40
  python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_file scripts/txt_files/manually_annotated_files/val_files_15.txt -o data/validation_set_annotated_only
41
  python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_file scripts/txt_files/manually_annotated_files/semisup_files_207.txt -o data/semisupervised_set_annotated_only
42
  python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_file scripts/txt_files/manually_annotated_files/test_files_116.txt -o data/test_set_annotated_only
 
 
 
 
 
 
 
 
 
 
40
  python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_file scripts/txt_files/manually_annotated_files/val_files_15.txt -o data/validation_set_annotated_only
41
  python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_file scripts/txt_files/manually_annotated_files/semisup_files_207.txt -o data/semisupervised_set_annotated_only
42
  python scripts/symlinks_from_txt_list.py vre_dronescapes/ --copy_files --txt_file scripts/txt_files/manually_annotated_files/test_files_116.txt -o data/test_set_annotated_only
43
+
44
+
45
+ # new videos
46
+
47
+ tmux new -s poli
48
+ VRE_DEVICE=cuda CUDA_VISIBLE_DEVICES=0 vre ../raw_data/videos/new_videos/politehnica_DJI_0708_540p.mp4 -o politehnica_DJI_0708_540p/ --config_path cfg.yaml --output_dir_exists_mode skip_computed --exception_mode skip_representation --n_threads_data_storer 4 -I ../scripts/semantic_mapper/semantic_mapper.py:get_new_semantic_mapped_tasks;
49
+
50
+ tmux new -s norway2
51
+ VRE_DEVICE=cuda CUDA_VISIBLE_DEVICES=1 vre ../raw_data/videos/new_videos/norawy2_DJI_0741_540p.mp4 -o norawy2_DJI_0741_540p/ --config_path cfg.yaml --output_dir_exists_mode skip_computed --exception_mode skip_representation --n_threads_data_storer 4 -I ../scripts/semantic_mapper/semantic_mapper.py:get_new_semantic_mapped_tasks