simba-uw-tf-dev 4.5.8__py3-none-any.whl → 4.6.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simba/SimBA.py +2 -2
- simba/assets/icons/frames_2.png +0 -0
- simba/assets/lookups/tooptips.json +10 -1
- simba/plotting/frame_mergerer_ffmpeg.py +137 -196
- simba/sandbox/cuda/egocentric_rotator.py +374 -0
- simba/ui/pop_ups/clf_add_remove_print_pop_up.py +37 -30
- simba/ui/pop_ups/egocentric_alignment_pop_up.py +20 -21
- simba/ui/pop_ups/interpolate_pop_up.py +2 -4
- simba/ui/pop_ups/multiple_videos_to_frames_popup.py +10 -11
- simba/ui/pop_ups/single_video_to_frames_popup.py +10 -10
- simba/ui/pop_ups/video_processing_pop_up.py +149 -145
- simba/ui/tkinter_functions.py +7 -1
- simba/video_processors/clahe_ui.py +65 -22
- simba/video_processors/egocentric_video_rotator.py +6 -7
- simba/video_processors/video_processing.py +73 -151
- simba/video_processors/videos_to_frames.py +3 -2
- {simba_uw_tf_dev-4.5.8.dist-info → simba_uw_tf_dev-4.6.2.dist-info}/METADATA +1 -1
- {simba_uw_tf_dev-4.5.8.dist-info → simba_uw_tf_dev-4.6.2.dist-info}/RECORD +22 -20
- {simba_uw_tf_dev-4.5.8.dist-info → simba_uw_tf_dev-4.6.2.dist-info}/LICENSE +0 -0
- {simba_uw_tf_dev-4.5.8.dist-info → simba_uw_tf_dev-4.6.2.dist-info}/WHEEL +0 -0
- {simba_uw_tf_dev-4.5.8.dist-info → simba_uw_tf_dev-4.6.2.dist-info}/entry_points.txt +0 -0
- {simba_uw_tf_dev-4.5.8.dist-info → simba_uw_tf_dev-4.6.2.dist-info}/top_level.txt +0 -0
|
@@ -79,13 +79,12 @@ sys.setrecursionlimit(10**7)
|
|
|
79
79
|
|
|
80
80
|
class CLAHEPopUp(PopUpMixin):
|
|
81
81
|
def __init__(self):
|
|
82
|
-
super().__init__(title="CLAHE VIDEO CONVERSION")
|
|
82
|
+
super().__init__(title="CLAHE VIDEO CONVERSION", icon='clahe')
|
|
83
83
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name='settings', icon_link=Links.VIDEO_TOOLS.value)
|
|
84
84
|
lbl = SimBALabel(parent=settings_frm, txt='For more control over CLAHE conversion, try "Interactively CLAHE enhance videos" \n in SimBA Tools->Remove color from videos.', font=Formats.FONT_REGULAR_ITALICS.value)
|
|
85
|
-
self.core_cnt_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(1, find_core_cnt()[0]+1)), label='CORE COUNT:', label_width=25, dropdown_width=20, value=1)
|
|
86
|
-
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label='USE GPU:', label_width=25, dropdown_width=20, value='FALSE')
|
|
87
|
-
if not check_nvidea_gpu_available():
|
|
88
|
-
self.gpu_dropdown.disable()
|
|
85
|
+
self.core_cnt_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(1, find_core_cnt()[0]+1)), label='CORE COUNT:', label_width=25, dropdown_width=20, value=1, img='cpu_small')
|
|
86
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label='USE GPU:', label_width=25, dropdown_width=20, value='FALSE', img='gpu_3')
|
|
87
|
+
if not check_nvidea_gpu_available(): self.gpu_dropdown.disable()
|
|
89
88
|
|
|
90
89
|
settings_frm.grid(row=0, column=0, sticky=NW)
|
|
91
90
|
lbl.grid(row=0, column=0, sticky=NW)
|
|
@@ -93,10 +92,10 @@ class CLAHEPopUp(PopUpMixin):
|
|
|
93
92
|
self.gpu_dropdown.grid(row=2, column=0, sticky=NW)
|
|
94
93
|
|
|
95
94
|
single_video_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SINGLE VIDEO - Contrast Limited Adaptive Histogram Equalization", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
96
|
-
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=25)
|
|
95
|
+
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=25, lbl_icon='video_2')
|
|
97
96
|
run_single_video_btn = SimbaButton(parent=single_video_frm, txt="Apply CLAHE on VIDEO", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=self.run_single_video, width=160)
|
|
98
97
|
multiple_videos_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="MULTIPLE VIDEOs - Contrast Limited Adaptive Histogram Equalization", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
99
|
-
self.selected_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", lblwidth=25)
|
|
98
|
+
self.selected_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", lblwidth=25, lbl_icon='folder')
|
|
100
99
|
|
|
101
100
|
run_multiple_btn = SimbaButton(parent=multiple_videos_frm, txt="Apply CLAHE on DIRECTORY", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=self.run_directory, width=160)
|
|
102
101
|
single_video_frm.grid(row=1, column=0, sticky=NW)
|
|
@@ -609,15 +608,18 @@ class ConvertVideoPopUp(PopUpMixin):
|
|
|
609
608
|
|
|
610
609
|
class ExtractSpecificFramesPopUp(PopUpMixin):
|
|
611
610
|
def __init__(self):
|
|
612
|
-
PopUpMixin.__init__(self, title="EXTRACT DEFINED FRAME RANGE FROM VIDEO", icon='frames')
|
|
611
|
+
PopUpMixin.__init__(self, title="EXTRACT DEFINED FRAME RANGE FROM SINGLE VIDEO", icon='frames')
|
|
613
612
|
self.settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm,header="SETTINGS", icon_name=Keys.DOCUMENTATION.value,icon_link=Links.VIDEO_TOOLS.value)
|
|
614
|
-
self.video_file_selected = FileSelect(self.settings_frm , "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=40)
|
|
615
|
-
self.save_dir = FolderSelect(self.settings_frm, "SAVE DIRECTORY: ", lblwidth=40, tooltip_txt='Optional directory where to save the images. \n If None, images are saved in a folder with the suffix `_frames` \n within the same directory as the video file')
|
|
613
|
+
self.video_file_selected = FileSelect(self.settings_frm , "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=40, lbl_icon='video_2')
|
|
614
|
+
self.save_dir = FolderSelect(self.settings_frm, "SAVE DIRECTORY: ", lblwidth=40, tooltip_txt='Optional directory where to save the images. \n If None, images are saved in a folder with the suffix `_frames` \n within the same directory as the video file', lbl_icon='folder')
|
|
615
|
+
|
|
616
|
+
self.format_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['jpeg', 'png', 'webp'], label="SAVE FORMAT: ", label_width=40, dropdown_width=25, value='png', img='file_type')
|
|
617
|
+
self.grey_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="GREYSCALE: ", label_width=40, dropdown_width=25, value='FALSE', img='grey')
|
|
618
|
+
self.clahe_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="CLAHE: ", label_width=40, dropdown_width=25, value='FALSE', img='clahe')
|
|
619
|
+
self.include_fn_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="INCLUDE VIDEO NAME IN IMAGE NAME: ", label_width=40, dropdown_width=25, value='FALSE', img='id_card_2')
|
|
620
|
+
self.start_frm = Entry_Box(parent=self.settings_frm, fileDescription="START FRAME NUMBER:", labelwidth=40, validation='numeric', width=25, img='play')
|
|
621
|
+
self.end_frm = Entry_Box(parent=self.settings_frm, fileDescription="END FRAME NUMBER:", labelwidth=40, validation='numeric', width=25, img='stop')
|
|
616
622
|
|
|
617
|
-
self.format_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['jpeg', 'png', 'webp'], label="FORMAT: ", label_width=40, dropdown_width=25, value='png')
|
|
618
|
-
self.grey_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="GREYSCALE: ", label_width=40, dropdown_width=25, value='FALSE')
|
|
619
|
-
self.clahe_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="CLAHE: ", label_width=40, dropdown_width=25, value='FALSE')
|
|
620
|
-
self.include_fn_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="INCLUDE VIDEO NAME IN IMAGE NAME: ", label_width=40, dropdown_width=25, value='FALSE')
|
|
621
623
|
|
|
622
624
|
self.settings_frm.grid(row=0, column=0, sticky=NW)
|
|
623
625
|
self.video_file_selected.grid(row=0, column=0, sticky=NW)
|
|
@@ -626,16 +628,11 @@ class ExtractSpecificFramesPopUp(PopUpMixin):
|
|
|
626
628
|
self.grey_dropdown.grid(row=3, column=0, sticky=NW)
|
|
627
629
|
self.clahe_dropdown.grid(row=4, column=0, sticky=NW)
|
|
628
630
|
self.include_fn_dropdown.grid(row=5, column=0, sticky=NW)
|
|
631
|
+
self.start_frm.grid(row=6, column=0, sticky=NW)
|
|
632
|
+
self.end_frm.grid(row=7, column=0, sticky=NW)
|
|
629
633
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
self.end_frm = Entry_Box(select_frames_frm, "END FRAME NUMBER:", "40", validation='numeric')
|
|
633
|
-
run_btn = SimbaButton(parent=select_frames_frm, txt="RUN", img='rocket', font=Formats.FONT_REGULAR.value, cmd=self.start_frm_extraction)
|
|
634
|
-
|
|
635
|
-
select_frames_frm.grid(row=1, column=0, sticky=NW)
|
|
636
|
-
self.start_frm.grid(row=2, column=0, sticky=NW)
|
|
637
|
-
self.end_frm.grid(row=3, column=0, sticky=NW)
|
|
638
|
-
run_btn.grid(row=4, pady=5, sticky=NW)
|
|
634
|
+
run_btn = SimbaButton(parent=self.main_frm, txt="RUN", img='rocket', font=Formats.FONT_REGULAR.value, cmd=self.start_frm_extraction)
|
|
635
|
+
run_btn.grid(row=1, column=0, pady=5, sticky=NW)
|
|
639
636
|
self.main_frm.mainloop()
|
|
640
637
|
|
|
641
638
|
def start_frm_extraction(self):
|
|
@@ -848,30 +845,34 @@ class MergeFrames2VideoPopUp(PopUpMixin):
|
|
|
848
845
|
|
|
849
846
|
class CreateGIFPopUP(PopUpMixin):
|
|
850
847
|
def __init__(self):
|
|
851
|
-
PopUpMixin.__init__(self, title="CREATE GIF FROM VIDEO", size=(600, 400), icon='gif')
|
|
852
|
-
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
853
|
-
self.selected_video = FileSelect(settings_frm, "VIDEO PATH: ", title="Select a video file", file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=40)
|
|
854
|
-
self.start_time_entry_box = Entry_Box(settings_frm, "START TIME (s):", "40", validation="numeric")
|
|
855
|
-
self.duration_entry_box = Entry_Box(settings_frm, "DURATION (s): ", "40", validation="numeric")
|
|
856
848
|
resolution_widths = Options.RESOLUTION_OPTIONS_2.value
|
|
857
|
-
self.resolution_dropdown = DropDownMenu(settings_frm, "GIF WIDTH (ASPECT RATIO RETAINED):", resolution_widths, "40")
|
|
858
|
-
self.quality_dropdown = DropDownMenu(settings_frm, "GIF QUALITY (%):", list(range(1, 101, 1)), "40")
|
|
859
849
|
fps_lst = list(range(1, 101, 1))
|
|
860
850
|
fps_lst.insert(0, 'AUTO')
|
|
861
|
-
|
|
862
|
-
|
|
851
|
+
gpu_state = NORMAL if check_nvidea_gpu_available(raise_error=False) else DISABLED
|
|
852
|
+
PopUpMixin.__init__(self, title="CREATE GIF FROM VIDEO", size=(600, 400), icon='gif')
|
|
853
|
+
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
863
854
|
|
|
864
|
-
self.
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
855
|
+
info_lbl = SimBALabel(parent=self.main_frm, txt='Consider creating WEBM videos instead of creating GIFs.\n WEBM is optimized for web publish at \nconsiderbly smaller sizes than GIFs.', txt_clr='blue', font=Formats.FONT_REGULAR_ITALICS.value, justify='center')
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
self.selected_video = FileSelect(settings_frm, "VIDEO PATH: ", title="Select a video file", file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=40, lbl_icon='video_2')
|
|
859
|
+
self.start_time_entry_box = Entry_Box(parent=settings_frm, fileDescription="START TIME (s):", labelwidth=40, validation="numeric", img='play', width=25)
|
|
860
|
+
self.duration_entry_box = Entry_Box(parent=settings_frm, fileDescription="DURATION (s):", labelwidth=40, validation="numeric", img='stop', width=25)
|
|
861
|
+
|
|
862
|
+
self.resolution_dropdown = SimBADropDown(parent=settings_frm, label="GIF WIDTH (ASPECT RATIO RETAINED):", dropdown_options=resolution_widths, label_width=40, dropdown_width=25, value='AUTO', img='monitor')
|
|
863
|
+
self.quality_dropdown = SimBADropDown(parent=settings_frm, label="GIF QUALITY (%):", dropdown_options=list(range(1, 101, 1)), label_width=40, dropdown_width=25, value=100, img='pct_2')
|
|
864
|
+
self.fps_dropdown = SimBADropDown(parent=settings_frm, label="GIF FPS:", dropdown_options=fps_lst, label_width=40, dropdown_width=25, value='AUTO', img='fps')
|
|
865
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, label="USE GPU:", dropdown_options=['TRUE', 'FALSE'], label_width=40, dropdown_width=25, value='FALSE', img='gpu_3', state=gpu_state)
|
|
866
|
+
|
|
867
|
+
info_lbl.grid(row=0, sticky=NW)
|
|
868
|
+
settings_frm.grid(row=1, sticky=NW)
|
|
868
869
|
self.selected_video.grid(row=0, sticky=NW, pady=5)
|
|
869
870
|
self.start_time_entry_box.grid(row=1, sticky=NW)
|
|
870
871
|
self.duration_entry_box.grid(row=2, sticky=NW)
|
|
871
872
|
self.resolution_dropdown.grid(row=3, sticky=NW)
|
|
872
873
|
self.quality_dropdown.grid(row=4, sticky=NW)
|
|
873
874
|
self.fps_dropdown.grid(row=5, sticky=NW)
|
|
874
|
-
|
|
875
|
+
self.gpu_dropdown.grid(row=6, column=0, sticky=NW)
|
|
875
876
|
self.create_run_frm(run_function=self.run)
|
|
876
877
|
self.main_frm.mainloop()
|
|
877
878
|
|
|
@@ -882,7 +883,7 @@ class CreateGIFPopUP(PopUpMixin):
|
|
|
882
883
|
duration = self.duration_entry_box.entry_get
|
|
883
884
|
fps = self.fps_dropdown.getChoices()
|
|
884
885
|
quality = int(self.quality_dropdown.getChoices())
|
|
885
|
-
gpu = self.
|
|
886
|
+
gpu = self.gpu_dropdown.get_value()
|
|
886
887
|
check_ffmpeg_available()
|
|
887
888
|
if gpu: check_nvidea_gpu_available()
|
|
888
889
|
check_file_exist_and_readable(file_path=video_path)
|
|
@@ -892,7 +893,7 @@ class CreateGIFPopUP(PopUpMixin):
|
|
|
892
893
|
if fps == 'AUTO': fps = int(video_meta_data['fps'])
|
|
893
894
|
else: fps = int(fps)
|
|
894
895
|
if fps > int(video_meta_data['fps']):
|
|
895
|
-
FrameRangeWarning(msg=f'The chosen FPS ({fps}) is higher than the video FPS ({video_meta_data["fps"]}). The video FPS will be used', source=self.__class__.__name__)
|
|
896
|
+
FrameRangeWarning(msg=f'The chosen FPS ({fps}) is higher than the video FPS ({video_meta_data["fps"]}). The video FPS will be used ({video_meta_data["fps"]})', source=self.__class__.__name__)
|
|
896
897
|
fps = int(video_meta_data['fps'])
|
|
897
898
|
max_duration = video_meta_data['video_length_s'] - int(start_time)
|
|
898
899
|
check_int(name='start_time', value=start_time, max_value=video_meta_data['video_length_s'], min_value=0)
|
|
@@ -1000,26 +1001,31 @@ class ConcatenatingVideosPopUp(PopUpMixin):
|
|
|
1000
1001
|
|
|
1001
1002
|
class ConcatenatorPopUp(PopUpMixin, ConfigReader):
|
|
1002
1003
|
def __init__(self, config_path: Optional[Union[str, os.PathLike]] = None):
|
|
1004
|
+
|
|
1005
|
+
self.RESOLUTIONS = ["480", "640", "1280", "1920", "2560"]
|
|
1006
|
+
self.CONCAT_TYPES_1 = {'HORIZONTAL': 'horizontal', 'MIXED MOSAIC': 'mixed_mosaic', 'MOSAIC': 'mosaic', 'VERTICAL': 'vertical'}
|
|
1007
|
+
self.CONCAT_TYPES_2 = {'horizontal': 'HORIZONTAL', 'mixed_mosaic': 'MIXED MOSAIC', 'mosaic': 'MOSAIC', 'vertical': 'VERTICAL'}
|
|
1003
1008
|
self.gpu_available = NORMAL if check_nvidea_gpu_available() else DISABLED
|
|
1004
1009
|
PopUpMixin.__init__(self, title="MERGE (CONCATENATE) VIDEOS", icon='concat_videos')
|
|
1005
1010
|
self.config_path = config_path
|
|
1006
1011
|
self.select_video_cnt_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="NUMBER OF VIDEOS TO CONCATENATE", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.CONCAT_VIDEOS.value)
|
|
1007
|
-
self.select_video_cnt_dropdown = SimBADropDown(parent=self.select_video_cnt_frm, dropdown_options=list(range(2, 21)), label="VIDEOS #", label_width=
|
|
1012
|
+
self.select_video_cnt_dropdown = SimBADropDown(parent=self.select_video_cnt_frm, dropdown_options=list(range(2, 21)), label="VIDEOS #", label_width=30, dropdown_width=25, value=2, command=lambda value: self.populate_table(int(value)), img='stack')
|
|
1008
1013
|
self.select_video_cnt_frm.grid(row=0, column=0, sticky=NW)
|
|
1009
1014
|
self.select_video_cnt_dropdown.grid(row=0, column=0, sticky=NW)
|
|
1010
1015
|
self.populate_table(video_cnt=int(self.select_video_cnt_dropdown.get_value()))
|
|
1011
|
-
|
|
1016
|
+
# self.main_frm.mainloop()
|
|
1012
1017
|
|
|
1013
1018
|
def populate_table(self, video_cnt):
|
|
1014
1019
|
if hasattr(self, "video_table_frm"): self.video_table_frm.destroy()
|
|
1015
1020
|
if hasattr(self, "join_type_frm"): self.join_type_frm.destroy()
|
|
1016
|
-
self.video_table_frm =
|
|
1021
|
+
self.video_table_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="VIDEO PATHS", icon_name='video_2', icon_link=Links.CONCAT_VIDEOS.value, pady=5, padx=5)
|
|
1017
1022
|
self.video_table_frm.grid(row=1, sticky=NW)
|
|
1018
1023
|
self.videos_dict = {}
|
|
1019
1024
|
for cnt in range(int(video_cnt)):
|
|
1020
|
-
self.videos_dict[cnt] = FileSelect(self.video_table_frm, f"VIDEO {cnt+1}: ", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)])
|
|
1025
|
+
self.videos_dict[cnt] = FileSelect(self.video_table_frm, f"VIDEO {cnt+1}: ", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=30, lbl_icon='video_2')
|
|
1021
1026
|
self.videos_dict[cnt].grid(row=cnt, column=0, sticky=NW)
|
|
1022
|
-
|
|
1027
|
+
|
|
1028
|
+
self.join_type_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="JOIN TYPE", icon_name='category', icon_link=Links.CONCAT_VIDEOS.value, pady=5, padx=5)
|
|
1023
1029
|
self.join_type_frm.grid(row=2, sticky=NW)
|
|
1024
1030
|
self.join_type_var = StringVar()
|
|
1025
1031
|
self.icons_dict = {}
|
|
@@ -1030,22 +1036,24 @@ class ConcatenatorPopUp(PopUpMixin, ConfigReader):
|
|
|
1030
1036
|
_, file_name, _ = get_fn_ext(file_path)
|
|
1031
1037
|
self.icons_dict[file_name] = {}
|
|
1032
1038
|
self.icons_dict[file_name]["img"] = ImageTk.PhotoImage(Image.open(file_path))
|
|
1033
|
-
|
|
1034
|
-
self.icons_dict[file_name]["btn"] = SimBARadioButton(parent=self.join_type_frm, txt=file_name, variable=self.join_type_var, img=self.icons_dict[file_name]["img"], value=file_name)
|
|
1039
|
+
self.icons_dict[file_name]["btn"] = SimBARadioButton(parent=self.join_type_frm, txt=self.CONCAT_TYPES_2[file_name], variable=self.join_type_var, img=self.icons_dict[file_name]["img"], value=self.CONCAT_TYPES_2[file_name], compound='bottom', font=Formats.FONT_REGULAR_BOLD.value)
|
|
1035
1040
|
self.icons_dict[file_name]["btn"].grid(row=0, column=file_cnt, sticky=NW)
|
|
1036
1041
|
self.join_type_var.set(value="mosaic")
|
|
1037
|
-
self.resolution_frm =
|
|
1038
|
-
self.resolution_width = SimBADropDown(parent=self.resolution_frm, dropdown_options=
|
|
1039
|
-
self.resolution_height = SimBADropDown(parent=self.resolution_frm, dropdown_options=
|
|
1040
|
-
self.
|
|
1041
|
-
self.gpu_dropdown = SimBADropDown(parent=self.
|
|
1042
|
+
self.resolution_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="RESOLUTION", icon_name='monitor', icon_link=Links.CONCAT_VIDEOS.value, pady=5, padx=5, tooltip_key='CONCAT_RES_HEADER')
|
|
1043
|
+
self.resolution_width = SimBADropDown(parent=self.resolution_frm, dropdown_options=self.RESOLUTIONS, label='WIDTH:', label_width=30, dropdown_width=25, value="480", img='width', tooltip_key="CONCAT_WIDTH")
|
|
1044
|
+
self.resolution_height = SimBADropDown(parent=self.resolution_frm, dropdown_options=self.RESOLUTIONS, label='HEIGHT:', label_width=30, dropdown_width=25, value="640", img='height', tooltip_key="CONCAT_HEIGHT")
|
|
1045
|
+
self.settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name='settings', icon_link=Links.CONCAT_VIDEOS.value, pady=5, padx=5)
|
|
1046
|
+
self.gpu_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=['TRUE', 'FALSE'], label="USE GPU:", label_width=30, dropdown_width=25, value='FALSE', img='gpu_3', state=self.gpu_available, tooltip_key='USE_GPU')
|
|
1047
|
+
self.quality_dropdown = SimBADropDown(parent=self.settings_frm, dropdown_options=list(range(10, 110, 10)), label="OUT VIDEO QUALITY:", label_width=30, dropdown_width=25, value=60, img='pct_2', state=self.gpu_available, tooltip_key='OUTPUT_VIDEO_QUALITY')
|
|
1048
|
+
|
|
1042
1049
|
self.gpu_dropdown.grid(row=0, column=0, sticky="NW")
|
|
1050
|
+
self.quality_dropdown.grid(row=1, column=0, sticky="NW")
|
|
1043
1051
|
self.resolution_frm.grid(row=3, column=0, sticky=NW)
|
|
1044
|
-
self.
|
|
1052
|
+
self.settings_frm.grid(row=4, column=0, sticky="NW")
|
|
1045
1053
|
self.resolution_width.grid(row=0, column=0, sticky=NW)
|
|
1046
1054
|
self.resolution_height.grid(row=1, column=0, sticky=NW)
|
|
1047
1055
|
|
|
1048
|
-
run_btn =
|
|
1056
|
+
run_btn = SimbaButton(parent=self.main_frm, txt='RUN', img='rocket', cmd=self.run)
|
|
1049
1057
|
run_btn.grid(row=5, column=0, sticky=NW)
|
|
1050
1058
|
|
|
1051
1059
|
def run(self):
|
|
@@ -1054,17 +1062,23 @@ class ConcatenatorPopUp(PopUpMixin, ConfigReader):
|
|
|
1054
1062
|
_ = get_video_meta_data(video_path=video_data.file_path)
|
|
1055
1063
|
file_paths.append(video_data.file_path)
|
|
1056
1064
|
if (len(file_paths) < 3) & (self.join_type_var.get() == "mixed_mosaic"):
|
|
1057
|
-
raise MixedMosaicError(msg="If using the mixed mosaic join type, please
|
|
1065
|
+
raise MixedMosaicError(msg="If using the mixed mosaic join type, please use at least 3 videos.", source=self.__class__.__name__ )
|
|
1058
1066
|
if (len(file_paths) < 3) & (self.join_type_var.get() == "mosaic"):
|
|
1059
1067
|
self.join_type_var.set(value="vertical")
|
|
1060
1068
|
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
1069
|
+
quality = int(self.quality_dropdown.get_value())
|
|
1070
|
+
quality_crf = quality_pct_to_crf(pct=quality)
|
|
1071
|
+
|
|
1072
|
+
join_type = self.CONCAT_TYPES_1[self.join_type_var.get()]
|
|
1073
|
+
|
|
1061
1074
|
|
|
1062
1075
|
video_merger = FrameMergererFFmpeg(config_path=self.config_path,
|
|
1063
1076
|
video_paths=file_paths,
|
|
1064
1077
|
video_height=int(self.resolution_height.getChoices()),
|
|
1065
1078
|
video_width=int(self.resolution_width.getChoices()),
|
|
1066
|
-
concat_type=
|
|
1067
|
-
gpu=gpu
|
|
1079
|
+
concat_type=join_type,
|
|
1080
|
+
gpu=gpu,
|
|
1081
|
+
quality=quality_crf)
|
|
1068
1082
|
|
|
1069
1083
|
threading.Thread(target=video_merger.run())
|
|
1070
1084
|
|
|
@@ -1342,7 +1356,7 @@ class DownsampleVideoPopUp(PopUpMixin):
|
|
|
1342
1356
|
file_path=self.video_path_selected.file_path,
|
|
1343
1357
|
video_width=int(width),
|
|
1344
1358
|
video_height=int(height),
|
|
1345
|
-
gpu=self.
|
|
1359
|
+
gpu=str_2_bool(self.gpu_dropdown.get_value()),
|
|
1346
1360
|
quality=quality_crf,
|
|
1347
1361
|
)
|
|
1348
1362
|
|
|
@@ -1752,16 +1766,16 @@ class BrightnessContrastPopUp(PopUpMixin):
|
|
|
1752
1766
|
:align: center
|
|
1753
1767
|
"""
|
|
1754
1768
|
def __init__(self):
|
|
1755
|
-
super().__init__(title="CHANGE BRIGHTNESS / CONTRAST")
|
|
1769
|
+
super().__init__(title="CHANGE BRIGHTNESS / CONTRAST", icon='brightness')
|
|
1756
1770
|
self.datetime = datetime.now().strftime("%Y%m%d%H%M%S")
|
|
1757
1771
|
setting_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
1758
1772
|
gpu_available = NORMAL if check_nvidea_gpu_available() else DISABLED
|
|
1759
|
-
self.gpu_dropdown = SimBADropDown(parent=setting_frm, label="USE GPU:", dropdown_options=['TRUE', 'FALSE'], dropdown_width=20, value='FALSE', state=gpu_available, img='gpu_3')
|
|
1773
|
+
self.gpu_dropdown = SimBADropDown(parent=setting_frm, label="USE GPU:", dropdown_options=['TRUE', 'FALSE'], dropdown_width=20, value='FALSE', state=gpu_available, img='gpu_3', label_width=25)
|
|
1760
1774
|
setting_frm.grid(row=0, column=0, sticky="NW")
|
|
1761
1775
|
self.gpu_dropdown.grid(row=0, column=0, sticky="NW")
|
|
1762
1776
|
|
|
1763
1777
|
single_video_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CHANGE BRIGHTNESS / CONTRAST SINGLE VIDEO", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
1764
|
-
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=25)
|
|
1778
|
+
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=25, lbl_icon='video_2')
|
|
1765
1779
|
run_video_btn = SimbaButton(parent=single_video_frm, txt="RUN SINGLE VIDEO", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=self.run_video)
|
|
1766
1780
|
|
|
1767
1781
|
single_video_frm.grid(row=1, column=0, sticky="NW")
|
|
@@ -1769,7 +1783,7 @@ class BrightnessContrastPopUp(PopUpMixin):
|
|
|
1769
1783
|
run_video_btn.grid(row=1, column=0, sticky="NW")
|
|
1770
1784
|
|
|
1771
1785
|
video_dir_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CHANGE BRIGHTNESS / CONTRAST MULTIPLE VIDEOS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
1772
|
-
self.selected_dir = FolderSelect(video_dir_frm, "VIDEO DIRECTORY PATH:", lblwidth=25)
|
|
1786
|
+
self.selected_dir = FolderSelect(video_dir_frm, "VIDEO DIRECTORY PATH:", lblwidth=25, lbl_icon='folder')
|
|
1773
1787
|
|
|
1774
1788
|
run_dir_btn = SimbaButton(parent=video_dir_frm, txt="RUN VIDEO DIRECTORY", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=self.run_directory)
|
|
1775
1789
|
|
|
@@ -1796,7 +1810,7 @@ class BrightnessContrastPopUp(PopUpMixin):
|
|
|
1796
1810
|
|
|
1797
1811
|
def apply(self):
|
|
1798
1812
|
timer = SimbaTimer(start=True)
|
|
1799
|
-
gpu = str_2_bool(self.gpu_dropdown.
|
|
1813
|
+
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
1800
1814
|
for file_cnt, file_path in enumerate(self.video_paths):
|
|
1801
1815
|
video_timer = SimbaTimer(start=True)
|
|
1802
1816
|
dir, video_name, ext = get_fn_ext(filepath=file_path)
|
|
@@ -1824,11 +1838,11 @@ class InteractiveClahePopUp(PopUpMixin):
|
|
|
1824
1838
|
"""
|
|
1825
1839
|
|
|
1826
1840
|
def __init__(self):
|
|
1827
|
-
super().__init__(title="INTERACTIVE CLAHE")
|
|
1841
|
+
super().__init__(title="INTERACTIVE CLAHE", icon='clahe')
|
|
1828
1842
|
self.datetime = datetime.now().strftime("%Y%m%d%H%M%S")
|
|
1829
1843
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name='settings', icon_link=Links.VIDEO_TOOLS.value)
|
|
1830
|
-
self.core_cnt_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(1, find_core_cnt()[0]+1)), label='CORE COUNT:', label_width=25, dropdown_width=20, value=1)
|
|
1831
|
-
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label='USE GPU:', label_width=25, dropdown_width=20, value='FALSE')
|
|
1844
|
+
self.core_cnt_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(1, find_core_cnt()[0]+1)), label='CORE COUNT:', label_width=25, dropdown_width=20, value=1, img='cpu_small')
|
|
1845
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label='USE GPU:', label_width=25, dropdown_width=20, value='FALSE', img='gpu_3')
|
|
1832
1846
|
if not check_nvidea_gpu_available():
|
|
1833
1847
|
self.gpu_dropdown.disable()
|
|
1834
1848
|
|
|
@@ -1839,7 +1853,7 @@ class InteractiveClahePopUp(PopUpMixin):
|
|
|
1839
1853
|
|
|
1840
1854
|
|
|
1841
1855
|
single_video_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="INTERACTIVE CLAHE - SINGLE VIDEO", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
1842
|
-
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=25)
|
|
1856
|
+
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", file_types=[("VIDEO", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lblwidth=25, lbl_icon='video_2')
|
|
1843
1857
|
run_video_btn = SimbaButton(parent=single_video_frm, txt="RUN SINGLE VIDEO", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=self.run_video, width=160)
|
|
1844
1858
|
|
|
1845
1859
|
|
|
@@ -1848,7 +1862,7 @@ class InteractiveClahePopUp(PopUpMixin):
|
|
|
1848
1862
|
run_video_btn.grid(row=1, column=0, sticky="NW")
|
|
1849
1863
|
|
|
1850
1864
|
video_dir_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="INTERACTIVE CLAHE - MULTIPLE VIDEOS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
1851
|
-
self.selected_dir = FolderSelect(video_dir_frm, "VIDEO DIRECTORY PATH:", lblwidth=25)
|
|
1865
|
+
self.selected_dir = FolderSelect(video_dir_frm, "VIDEO DIRECTORY PATH:", lblwidth=25, lbl_icon='folder')
|
|
1852
1866
|
run_dir_btn = SimbaButton(parent=video_dir_frm, txt="RUN VIDEO DIRECTORY", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=self.run_directory, width=160)
|
|
1853
1867
|
video_dir_frm.grid(row=2, column=0, sticky="NW")
|
|
1854
1868
|
self.selected_dir.grid(row=0, column=0, sticky="NW")
|
|
@@ -1907,7 +1921,7 @@ class DownsampleSingleVideoPopUp(PopUpMixin):
|
|
|
1907
1921
|
self.gpu_dropdown.grid(row=0, column=0, sticky=NW)
|
|
1908
1922
|
|
|
1909
1923
|
quality_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="OUTPUT QUALITY", icon_name='pct_2', icon_link=Links.DOWNSAMPLE.value)
|
|
1910
|
-
self.quality_dropdown = SimBADropDown(parent=quality_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY:", label_width=
|
|
1924
|
+
self.quality_dropdown = SimBADropDown(parent=quality_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY:", label_width=20, dropdown_width=35, value=60, img='pct_2', tooltip_key='OUPUT_VIDEO_QUALITY')
|
|
1911
1925
|
quality_frm.grid(row=2, column=0, sticky=NW)
|
|
1912
1926
|
self.quality_dropdown.grid(row=0, column=0, sticky=NW)
|
|
1913
1927
|
|
|
@@ -1970,13 +1984,13 @@ class DownsampleMultipleVideosPopUp(PopUpMixin):
|
|
|
1970
1984
|
|
|
1971
1985
|
gpu_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="GPU (REDUCED RUNTIMES)", icon_name='gpu_3', icon_link=Links.DOWNSAMPLE.value)
|
|
1972
1986
|
gpu_available = NORMAL if check_nvidea_gpu_available() else DISABLED
|
|
1973
|
-
self.gpu_dropdown = SimBADropDown(parent=gpu_frm, label="USE GPU:", dropdown_options=['TRUE', 'FALSE'], dropdown_width=20, value='FALSE', state=gpu_available, img='gpu_3')
|
|
1987
|
+
self.gpu_dropdown = SimBADropDown(parent=gpu_frm, label="USE GPU:", dropdown_options=['TRUE', 'FALSE'], dropdown_width=20, value='FALSE', state=gpu_available, img='gpu_3', label_width=20)
|
|
1974
1988
|
|
|
1975
1989
|
gpu_frm.grid(row=1, column=0, sticky=NW)
|
|
1976
1990
|
self.gpu_dropdown.grid(row=0, column=0, sticky=NW)
|
|
1977
1991
|
|
|
1978
1992
|
quality_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="OUTPUT QUALITY", icon_name='pct_2', icon_link=Links.DOWNSAMPLE.value)
|
|
1979
|
-
self.quality_dropdown = SimBADropDown(parent=quality_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY:", label_width=
|
|
1993
|
+
self.quality_dropdown = SimBADropDown(parent=quality_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY:", label_width=20, dropdown_width=35, value=60, img='pct_2', tooltip_key='OUPUT_VIDEO_QUALITY')
|
|
1980
1994
|
quality_frm.grid(row=2, column=0, sticky=NW)
|
|
1981
1995
|
self.quality_dropdown.grid(row=0, column=0, sticky=NW)
|
|
1982
1996
|
|
|
@@ -2035,16 +2049,15 @@ class DownsampleMultipleVideosPopUp(PopUpMixin):
|
|
|
2035
2049
|
|
|
2036
2050
|
class Convert2jpegPopUp(PopUpMixin):
|
|
2037
2051
|
def __init__(self):
|
|
2038
|
-
super().__init__(title="CONVERT
|
|
2052
|
+
super().__init__(title="CONVERT IMAGES TO JPEG", icon='jpeg')
|
|
2039
2053
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2040
|
-
|
|
2041
|
-
self.quality_scale =
|
|
2042
|
-
self.quality_scale.set(95)
|
|
2054
|
+
|
|
2055
|
+
self.quality_scale = SimBAScaleBar(parent=settings_frm, label="JPEG OUTPUT QUALITY: ", orient=HORIZONTAL, length=200, value=95, label_width=25, lbl_img='pct_2')
|
|
2043
2056
|
settings_frm.grid(row=0, column=0, sticky="NW")
|
|
2044
2057
|
self.quality_scale.grid(row=0, column=0, sticky="NW")
|
|
2045
2058
|
|
|
2046
2059
|
img_dir_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CONVERT IMAGE DIRECTORY TO JPEG", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2047
|
-
self.selected_frame_dir = FolderSelect(img_dir_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25)
|
|
2060
|
+
self.selected_frame_dir = FolderSelect(img_dir_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25, lbl_icon='folder')
|
|
2048
2061
|
|
|
2049
2062
|
run_btn_dir = SimbaButton(parent=img_dir_frm, txt="RUN DIRECTORY JPEG CONVERSION", img='rocket', txt_clr='black', font=Formats.FONT_REGULAR.value, cmd=self.run_dir)
|
|
2050
2063
|
img_dir_frm.grid(row=1, column=0, sticky="NW")
|
|
@@ -2052,7 +2065,7 @@ class Convert2jpegPopUp(PopUpMixin):
|
|
|
2052
2065
|
run_btn_dir.grid(row=1, column=0, sticky="NW")
|
|
2053
2066
|
|
|
2054
2067
|
img_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CONVERT IMAGE TO JPEG", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2055
|
-
self.selected_file = FileSelect(img_frm, "IMAGE PATH:", title="Select an image file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_IMAGE_FORMAT_OPTIONS.value)])
|
|
2068
|
+
self.selected_file = FileSelect(img_frm, "IMAGE PATH:", title="Select an image file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_IMAGE_FORMAT_OPTIONS.value)], lbl_icon='frames')
|
|
2056
2069
|
|
|
2057
2070
|
run_btn_img = SimbaButton(parent=img_frm, txt="RUN IMAGE JPEG CONVERSION", img='rocket', txt_clr='black', font=Formats.FONT_REGULAR.value, cmd=self.run_img)
|
|
2058
2071
|
img_frm.grid(row=2, column=0, sticky="NW")
|
|
@@ -2062,19 +2075,19 @@ class Convert2jpegPopUp(PopUpMixin):
|
|
|
2062
2075
|
def run_dir(self):
|
|
2063
2076
|
folder_path = self.selected_frame_dir.folder_path
|
|
2064
2077
|
check_if_dir_exists(in_dir=folder_path)
|
|
2065
|
-
_ = convert_to_jpeg(path=folder_path, quality=int(self.quality_scale.
|
|
2078
|
+
_ = convert_to_jpeg(path=folder_path, quality=int(self.quality_scale.get_value()), verbose=True)
|
|
2066
2079
|
|
|
2067
2080
|
def run_img(self):
|
|
2068
2081
|
file_path = self.selected_file.file_path
|
|
2069
2082
|
check_file_exist_and_readable(file_path)
|
|
2070
|
-
_ = convert_to_jpeg(path=file_path, quality=int(self.quality_scale.
|
|
2083
|
+
_ = convert_to_jpeg(path=file_path, quality=int(self.quality_scale.get_value()), verbose=True)
|
|
2071
2084
|
|
|
2072
2085
|
|
|
2073
2086
|
class Convert2bmpPopUp(PopUpMixin):
|
|
2074
2087
|
def __init__(self):
|
|
2075
|
-
super().__init__(title="CONVERT IMAGES TO BMP")
|
|
2088
|
+
super().__init__(title="CONVERT IMAGES TO BMP", icon='bmp')
|
|
2076
2089
|
img_dir_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CONVERT IMAGE DIRECTORY TO BMP", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2077
|
-
self.selected_frame_dir = FolderSelect(img_dir_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25)
|
|
2090
|
+
self.selected_frame_dir = FolderSelect(img_dir_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25, lbl_icon='folder')
|
|
2078
2091
|
|
|
2079
2092
|
run_btn_dir = SimbaButton(parent=img_dir_frm, txt="RUN DIRECTORY BMP CONVERSION", img='rocket', txt_clr='black', font=Formats.FONT_REGULAR.value, cmd=self.run_dir)
|
|
2080
2093
|
img_dir_frm.grid(row=0, column=0, sticky="NW")
|
|
@@ -2082,8 +2095,8 @@ class Convert2bmpPopUp(PopUpMixin):
|
|
|
2082
2095
|
run_btn_dir.grid(row=1, column=0, sticky="NW")
|
|
2083
2096
|
|
|
2084
2097
|
img_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CONVERT IMAGE TO BMP", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2085
|
-
self.selected_file = FileSelect(img_frm, "IMAGE PATH:", title="Select an image file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_IMAGE_FORMAT_OPTIONS.value)])
|
|
2086
|
-
run_btn_img =
|
|
2098
|
+
self.selected_file = FileSelect(img_frm, "IMAGE PATH:", title="Select an image file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_IMAGE_FORMAT_OPTIONS.value)], lbl_icon='bmp')
|
|
2099
|
+
run_btn_img = SimbaButton(parent=img_frm, txt="RUN IMAGE BMP CONVERSION", img='rocket', txt_clr='black', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run_img())
|
|
2087
2100
|
|
|
2088
2101
|
img_frm.grid(row=1, column=0, sticky="NW")
|
|
2089
2102
|
self.selected_file.grid(row=0, column=0, sticky="NW")
|
|
@@ -2144,13 +2157,11 @@ class Convert2WEBPPopUp(PopUpMixin):
|
|
|
2144
2157
|
|
|
2145
2158
|
class Convert2TIFFPopUp(PopUpMixin):
|
|
2146
2159
|
def __init__(self):
|
|
2147
|
-
super().__init__(title="CONVERT IMAGE DIRECTORY TO TIFF")
|
|
2160
|
+
super().__init__(title="CONVERT IMAGE DIRECTORY TO TIFF", icon='tiff')
|
|
2148
2161
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2149
|
-
self.selected_frame_dir = FolderSelect(settings_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25)
|
|
2150
|
-
self.compression_dropdown =
|
|
2151
|
-
self.
|
|
2152
|
-
self.stack_dropdown = DropDownMenu(settings_frm, "STACK:", ['FALSE', 'TRUE'], labelwidth=25)
|
|
2153
|
-
self.stack_dropdown.setChoices('FALSE')
|
|
2162
|
+
self.selected_frame_dir = FolderSelect(settings_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25, lbl_icon='browse')
|
|
2163
|
+
self.compression_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['raw', 'tiff_deflate', 'tiff_lzw'], label="COMPRESSION:", label_width=25, dropdown_width=25, value='raw', img='file_type')
|
|
2164
|
+
self.stack_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['FALSE', 'TRUE'], label="STACK:", label_width=25, dropdown_width=25, value='FALSE', img='stack')
|
|
2154
2165
|
self.create_run_frm(run_function=self.run, title='RUN TIFF CONVERSION')
|
|
2155
2166
|
|
|
2156
2167
|
settings_frm.grid(row=0, column=0, sticky="NW")
|
|
@@ -2162,23 +2173,23 @@ class Convert2TIFFPopUp(PopUpMixin):
|
|
|
2162
2173
|
def run(self):
|
|
2163
2174
|
folder_path = self.selected_frame_dir.folder_path
|
|
2164
2175
|
check_if_dir_exists(in_dir=folder_path)
|
|
2165
|
-
stack = str_2_bool(self.stack_dropdown.
|
|
2166
|
-
convert_to_tiff(directory=folder_path, compression=self.compression_dropdown.
|
|
2176
|
+
stack = str_2_bool(self.stack_dropdown.get_value())
|
|
2177
|
+
convert_to_tiff(directory=folder_path, compression=self.compression_dropdown.get_value(), verbose=True, stack=stack)
|
|
2167
2178
|
|
|
2168
2179
|
class Convert2PNGPopUp(PopUpMixin):
|
|
2169
2180
|
def __init__(self):
|
|
2170
|
-
super().__init__(title="CONVERT IMAGE TO PNG")
|
|
2181
|
+
super().__init__(title="CONVERT IMAGE TO PNG", icon='png')
|
|
2171
2182
|
img_dir_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CONVERT IMAGE DIRECTORY TO PNG", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2172
|
-
self.selected_frame_dir = FolderSelect(img_dir_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25)
|
|
2173
|
-
run_btn_dir =
|
|
2183
|
+
self.selected_frame_dir = FolderSelect(img_dir_frm, "IMAGE DIRECTORY PATH:", title="Select a image directory", lblwidth=25, lbl_icon='folder')
|
|
2184
|
+
run_btn_dir = SimbaButton(parent=img_dir_frm, txt="RUN DIRECTORY PNG CONVERSION", img='rocket', txt_clr='black', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run_dir())
|
|
2174
2185
|
|
|
2175
2186
|
img_dir_frm.grid(row=0, column=0, sticky="NW")
|
|
2176
2187
|
self.selected_frame_dir.grid(row=0, column=0, sticky="NW")
|
|
2177
2188
|
run_btn_dir.grid(row=1, column=0, sticky="NW")
|
|
2178
2189
|
|
|
2179
2190
|
img_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="CONVERT IMAGE TO PNG", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2180
|
-
self.selected_file_dir = FileSelect(img_frm, "IMAGE PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_IMAGE_FORMAT_OPTIONS.value)])
|
|
2181
|
-
run_btn_img =
|
|
2191
|
+
self.selected_file_dir = FileSelect(img_frm, "IMAGE PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_IMAGE_FORMAT_OPTIONS.value)], lbl_icon='file_type')
|
|
2192
|
+
run_btn_img = SimbaButton(parent=img_frm, txt="RUN IMAGE PNG CONVERSION", img='rocket', txt_clr='black', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run_img())
|
|
2182
2193
|
|
|
2183
2194
|
img_frm.grid(row=1, column=0, sticky="NW")
|
|
2184
2195
|
self.selected_file_dir.grid(row=0, column=0, sticky="NW")
|
|
@@ -2647,7 +2658,7 @@ class SuperimposeVideoNamesPopUp(PopUpMixin):
|
|
|
2647
2658
|
self.font_border_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(self.color_dict.keys()), label_width=25, value='Black', label="FONT BORDER COLOR:", img='text')
|
|
2648
2659
|
self.font_border_width_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(2, 52, 2)), label_width=25, value=2, label="FONT BORDER WIDTH:", img='width')
|
|
2649
2660
|
self.quality_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY: ", label_width=25, dropdown_width=30, value=60, img='pct_2', tooltip_key='OUTPUT_VIDEO_QUALITY')
|
|
2650
|
-
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label_width=25, value='FALSE', label="USE GPU:", img='gpu_3', state=self.gpu_available)
|
|
2661
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label_width=25, value='FALSE', label="USE GPU:", img='gpu_3', state=self.gpu_available, tooltip_key='USE_GPU')
|
|
2651
2662
|
|
|
2652
2663
|
|
|
2653
2664
|
settings_frm.grid(row=0, column=0, sticky=NW)
|
|
@@ -2678,14 +2689,14 @@ class SuperimposeVideoNamesPopUp(PopUpMixin):
|
|
|
2678
2689
|
#self.main_frm.mainloop()
|
|
2679
2690
|
|
|
2680
2691
|
def run(self, multiple: bool):
|
|
2681
|
-
loc = self.location_dropdown.
|
|
2692
|
+
loc = self.location_dropdown.get_value()
|
|
2682
2693
|
loc = self.LOCATIONS[loc]
|
|
2683
|
-
gpu = str_2_bool(self.gpu_dropdown.
|
|
2684
|
-
font_size = int(self.font_size_dropdown.
|
|
2685
|
-
font = self.font_dropdown.
|
|
2686
|
-
font_clr = self.font_color_dropdown.
|
|
2687
|
-
font_border_clr = self.font_border_dropdown.
|
|
2688
|
-
font_border_width = int(self.font_border_width_dropdown.
|
|
2694
|
+
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
2695
|
+
font_size = int(self.font_size_dropdown.get_value())
|
|
2696
|
+
font = self.font_dropdown.get_value()
|
|
2697
|
+
font_clr = self.font_color_dropdown.get_value()
|
|
2698
|
+
font_border_clr = self.font_border_dropdown.get_value()
|
|
2699
|
+
font_border_width = int(self.font_border_width_dropdown.get_value())
|
|
2689
2700
|
if not multiple:
|
|
2690
2701
|
data_path = self.selected_video.file_path
|
|
2691
2702
|
check_file_exist_and_readable(file_path=data_path)
|
|
@@ -2693,7 +2704,7 @@ class SuperimposeVideoNamesPopUp(PopUpMixin):
|
|
|
2693
2704
|
data_path = self.selected_video_dir.folder_path
|
|
2694
2705
|
check_if_dir_exists(in_dir=data_path)
|
|
2695
2706
|
|
|
2696
|
-
quality = int(self.quality_dropdown.
|
|
2707
|
+
quality = int(self.quality_dropdown.get_value())
|
|
2697
2708
|
threading.Thread(target=superimpose_video_names(video_path=data_path,
|
|
2698
2709
|
font=font,
|
|
2699
2710
|
font_size=font_size,
|
|
@@ -2724,7 +2735,7 @@ class SuperimposeTextPopUp(PopUpMixin):
|
|
|
2724
2735
|
self.font_border_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(self.color_dict.keys()), label_width=25, value='Black', label="FONT BORDER COLOR:", img='line')
|
|
2725
2736
|
self.font_border_width_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(2, 52, 2)), label_width=25, value=2, label="FONT BORDER WIDTH:", img='width')
|
|
2726
2737
|
self.quality_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY: ", label_width=25, dropdown_width=30, value=60, img='pct_2', tooltip_key='OUTPUT_VIDEO_QUALITY')
|
|
2727
|
-
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label_width=25, value='FALSE', label="USE GPU:", img='gpu_3', state=self.gpu_available)
|
|
2738
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label_width=25, value='FALSE', label="USE GPU:", img='gpu_3', state=self.gpu_available, tooltip_key='USE_GPU')
|
|
2728
2739
|
|
|
2729
2740
|
settings_frm.grid(row=0, column=0, sticky=NW)
|
|
2730
2741
|
self.location_dropdown.grid(row=0, column=0, sticky=NW)
|
|
@@ -2747,7 +2758,7 @@ class SuperimposeTextPopUp(PopUpMixin):
|
|
|
2747
2758
|
|
|
2748
2759
|
multiple_videos_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="MULTIPLE VIDEOS - SUPERIMPOSE TEXT", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2749
2760
|
self.selected_video_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", title="Select a video directory", lblwidth=25, lbl_icon='folder')
|
|
2750
|
-
multiple_videos_run =
|
|
2761
|
+
multiple_videos_run = SimbaButton(parent=multiple_videos_frm, txt="RUN - MULTIPLE VIDEOS", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run(multiple=True))
|
|
2751
2762
|
|
|
2752
2763
|
multiple_videos_frm.grid(row=2, column=0, sticky="NW")
|
|
2753
2764
|
self.selected_video_dir.grid(row=0, column=0, sticky="NW")
|
|
@@ -2755,16 +2766,16 @@ class SuperimposeTextPopUp(PopUpMixin):
|
|
|
2755
2766
|
#self.main_frm.mainloop()
|
|
2756
2767
|
|
|
2757
2768
|
def run(self, multiple: bool):
|
|
2758
|
-
loc = self.location_dropdown.
|
|
2769
|
+
loc = self.location_dropdown.get_value()
|
|
2759
2770
|
loc = self.LOCATIONS[loc]
|
|
2760
2771
|
text = self.text_eb.entry_get
|
|
2761
|
-
gpu = str_2_bool(self.gpu_dropdown.
|
|
2772
|
+
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
2762
2773
|
check_str(name='text', value=text)
|
|
2763
|
-
font = self.font_dropdown.
|
|
2764
|
-
font_size = int(self.font_size_dropdown.
|
|
2765
|
-
font_clr = self.font_color_dropdown.
|
|
2766
|
-
font_border_clr = self.font_border_dropdown.
|
|
2767
|
-
font_border_width = int(self.font_border_width_dropdown.
|
|
2774
|
+
font = self.font_dropdown.get_value()
|
|
2775
|
+
font_size = int(self.font_size_dropdown.get_value())
|
|
2776
|
+
font_clr = self.font_color_dropdown.get_value()
|
|
2777
|
+
font_border_clr = self.font_border_dropdown.get_value()
|
|
2778
|
+
font_border_width = int(self.font_border_width_dropdown.get_value())
|
|
2768
2779
|
if not multiple:
|
|
2769
2780
|
data_path = self.selected_video.file_path
|
|
2770
2781
|
check_file_exist_and_readable(file_path=data_path)
|
|
@@ -2772,7 +2783,7 @@ class SuperimposeTextPopUp(PopUpMixin):
|
|
|
2772
2783
|
data_path = self.selected_video_dir.folder_path
|
|
2773
2784
|
check_if_dir_exists(in_dir=data_path)
|
|
2774
2785
|
|
|
2775
|
-
quality = int(self.quality_dropdown.
|
|
2786
|
+
quality = int(self.quality_dropdown.get_value())
|
|
2776
2787
|
threading.Thread(target=superimpose_freetext(video_path=data_path,
|
|
2777
2788
|
text=text,
|
|
2778
2789
|
font=font,
|
|
@@ -2803,7 +2814,7 @@ class BoxBlurPopUp(PopUpMixin):
|
|
|
2803
2814
|
|
|
2804
2815
|
single_video_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="APPLY BOX-BLUR", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
2805
2816
|
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lbl_icon='file')
|
|
2806
|
-
single_video_run =
|
|
2817
|
+
single_video_run = SimbaButton(parent=single_video_frm, txt="RUN", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run())
|
|
2807
2818
|
|
|
2808
2819
|
single_video_frm.grid(row=1, column=0, sticky="NW")
|
|
2809
2820
|
self.selected_video.grid(row=0, column=0, sticky="NW")
|
|
@@ -2814,8 +2825,8 @@ class BoxBlurPopUp(PopUpMixin):
|
|
|
2814
2825
|
def run(self):
|
|
2815
2826
|
video_path = self.selected_video.file_path
|
|
2816
2827
|
check_file_exist_and_readable(file_path=video_path)
|
|
2817
|
-
blur_lvl = float(self.blur_lvl_dropdown.
|
|
2818
|
-
invert = str_2_bool(self.invert_dropdown.
|
|
2828
|
+
blur_lvl = float(self.blur_lvl_dropdown.get_value())
|
|
2829
|
+
invert = str_2_bool(self.invert_dropdown.get_value())
|
|
2819
2830
|
threading.Thread(target=roi_blurbox(video_path=video_path, blur_level=blur_lvl, invert=invert)).start()
|
|
2820
2831
|
|
|
2821
2832
|
|
|
@@ -3044,7 +3055,7 @@ class RotateVideoSetDegreesPopUp(PopUpMixin):
|
|
|
3044
3055
|
self.gpu_dropdown.grid(row=2, column=0, sticky="NW")
|
|
3045
3056
|
|
|
3046
3057
|
single_video_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SINGLE VIDEO - ROTATE", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3047
|
-
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)])
|
|
3058
|
+
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lbl_icon='video_2')
|
|
3048
3059
|
single_video_run = SimbaButton(parent=single_video_frm, txt="RUN - SINGLE VIDEO", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run(multiple=False))
|
|
3049
3060
|
|
|
3050
3061
|
single_video_frm.grid(row=1, column=0, sticky="NW")
|
|
@@ -3052,7 +3063,7 @@ class RotateVideoSetDegreesPopUp(PopUpMixin):
|
|
|
3052
3063
|
single_video_run.grid(row=1, column=0, sticky="NW")
|
|
3053
3064
|
|
|
3054
3065
|
multiple_videos_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="MULTIPLE VIDEOS - ROTATE", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3055
|
-
self.selected_video_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", title="Select a video directory", lblwidth=25)
|
|
3066
|
+
self.selected_video_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", title="Select a video directory", lblwidth=25, lbl_icon='folder')
|
|
3056
3067
|
multiple_videos_run = SimbaButton(parent=multiple_videos_frm, txt="RUN - MULTIPLE VIDEOS", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run(multiple=True))
|
|
3057
3068
|
|
|
3058
3069
|
multiple_videos_frm.grid(row=2, column=0, sticky="NW")
|
|
@@ -3094,7 +3105,7 @@ class FlipVideosPopUp(PopUpMixin):
|
|
|
3094
3105
|
self.gpu_dropdown.grid(row=3, column=0, sticky="NW")
|
|
3095
3106
|
|
|
3096
3107
|
single_video_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SINGLE VIDEO - FLIP", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3097
|
-
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)])
|
|
3108
|
+
self.selected_video = FileSelect(single_video_frm, "VIDEO PATH:", title="Select a video file", lblwidth=25, file_types=[("VIDEO FILE", Options.ALL_VIDEO_FORMAT_STR_OPTIONS.value)], lbl_icon='video_2')
|
|
3098
3109
|
single_video_run = SimbaButton(parent=single_video_frm, txt="RUN - SINGLE VIDEO", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run(multiple=False))
|
|
3099
3110
|
|
|
3100
3111
|
single_video_frm.grid(row=1, column=0, sticky="NW")
|
|
@@ -3102,7 +3113,7 @@ class FlipVideosPopUp(PopUpMixin):
|
|
|
3102
3113
|
single_video_run.grid(row=1, column=0, sticky="NW")
|
|
3103
3114
|
|
|
3104
3115
|
multiple_videos_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="MULTIPLE VIDEOS - FLIP", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3105
|
-
self.selected_video_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", title="Select a video directory", lblwidth=25)
|
|
3116
|
+
self.selected_video_dir = FolderSelect(multiple_videos_frm, "VIDEO DIRECTORY PATH:", title="Select a video directory", lblwidth=25, lbl_icon='folder')
|
|
3106
3117
|
multiple_videos_run = SimbaButton(parent=multiple_videos_frm, txt="RUN - MULTIPLE VIDEOS", img='rocket', txt_clr='blue', font=Formats.FONT_REGULAR.value, cmd=lambda: self.run(multiple=True))
|
|
3107
3118
|
|
|
3108
3119
|
multiple_videos_frm.grid(row=2, column=0, sticky="NW")
|
|
@@ -3134,11 +3145,8 @@ class UpsampleVideosPopUp(PopUpMixin):
|
|
|
3134
3145
|
def __init__(self):
|
|
3135
3146
|
PopUpMixin.__init__(self, title="UPSAMPLE VIDEOS USING INTERPOLATION (WARNING: LONG RUN-TIMES)", icon='sample')
|
|
3136
3147
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3137
|
-
self.fps_dropdown =
|
|
3138
|
-
self.quality_dropdown =
|
|
3139
|
-
|
|
3140
|
-
self.fps_dropdown.setChoices(60)
|
|
3141
|
-
self.quality_dropdown.setChoices(60)
|
|
3148
|
+
self.fps_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(1, 500)), label="NEW FRAME-RATE (FPS):", label_width=25, dropdown_width=25, value=60, img='fps')
|
|
3149
|
+
self.quality_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY (%):", label_width=25, dropdown_width=25, value=60, img='pct_2', tooltip_key='OUTPUT_VIDEO_QUALITY')
|
|
3142
3150
|
settings_frm.grid(row=0, column=0, sticky="NW")
|
|
3143
3151
|
self.fps_dropdown.grid(row=0, column=0, sticky="NW")
|
|
3144
3152
|
self.quality_dropdown.grid(row=1, column=0, sticky="NW")
|
|
@@ -3161,8 +3169,8 @@ class UpsampleVideosPopUp(PopUpMixin):
|
|
|
3161
3169
|
self.main_frm.mainloop()
|
|
3162
3170
|
|
|
3163
3171
|
def run(self, multiple: bool):
|
|
3164
|
-
target_fps = int(self.fps_dropdown.
|
|
3165
|
-
target_quality = int(self.quality_dropdown.
|
|
3172
|
+
target_fps = int(self.fps_dropdown.get_value())
|
|
3173
|
+
target_quality = int(self.quality_dropdown.get_value())
|
|
3166
3174
|
if not multiple:
|
|
3167
3175
|
data_path = self.selected_video.file_path
|
|
3168
3176
|
check_file_exist_and_readable(file_path=data_path)
|
|
@@ -3181,12 +3189,10 @@ class ReverseVideoPopUp(PopUpMixin):
|
|
|
3181
3189
|
PopUpMixin.__init__(self, title="REVERSE VIDEOS", icon='reverse_blue')
|
|
3182
3190
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3183
3191
|
self.MP4_CODEC_LK = {'HEVC (H.265)': 'libx265', 'H.264 (AVC)': 'libx264', 'VP9': 'vp9'}
|
|
3184
|
-
|
|
3185
|
-
self.quality_dropdown
|
|
3186
|
-
self.codec_dropdown =
|
|
3187
|
-
self.
|
|
3188
|
-
self.gpu_dropdown = DropDownMenu(settings_frm, "USE GPU:", ['TRUE', 'FALSE'], labelwidth=25)
|
|
3189
|
-
self.gpu_dropdown.setChoices('FALSE')
|
|
3192
|
+
gpu_state = NORMAL if check_nvidea_gpu_available(raise_error=False) else DISABLED
|
|
3193
|
+
self.quality_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(range(10, 110, 10)), label="OUTPUT VIDEO QUALITY:", label_width=25, dropdown_width=25, value=60, img='pct_2', tooltip_key='OUTPUT_VIDEO_QUALITY')
|
|
3194
|
+
self.codec_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=list(self.MP4_CODEC_LK.keys()), label="COMPRESSION CODEC:", label_width=25, dropdown_width=25, value='HEVC (H.265)', img='file_type')
|
|
3195
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label="USE GPU:", label_width=25, dropdown_width=25, value='FALSE', img='gpu_3', state=gpu_state, tooltip_key='USE_GPU')
|
|
3190
3196
|
|
|
3191
3197
|
settings_frm.grid(row=0, column=0, sticky=NW)
|
|
3192
3198
|
self.quality_dropdown.grid(row=0, column=0, sticky=NW)
|
|
@@ -3211,9 +3217,9 @@ class ReverseVideoPopUp(PopUpMixin):
|
|
|
3211
3217
|
#self.main_frm.mainloop()
|
|
3212
3218
|
|
|
3213
3219
|
def run(self, multiple: bool):
|
|
3214
|
-
target_quality = int(self.quality_dropdown.
|
|
3215
|
-
codec = self.MP4_CODEC_LK[self.codec_dropdown.
|
|
3216
|
-
gpu = str_2_bool(self.gpu_dropdown.
|
|
3220
|
+
target_quality = int(self.quality_dropdown.get_value())
|
|
3221
|
+
codec = self.MP4_CODEC_LK[self.codec_dropdown.get_value()]
|
|
3222
|
+
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
3217
3223
|
if not multiple:
|
|
3218
3224
|
data_path = self.selected_video.file_path
|
|
3219
3225
|
check_file_exist_and_readable(file_path=data_path)
|
|
@@ -3231,11 +3237,9 @@ class Convert2BlackWhitePopUp(PopUpMixin):
|
|
|
3231
3237
|
PopUpMixin.__init__(self, title="CONVERT VIDEOS TO BLACK AND WHITE (NOTE: NOT GRAYSCALE)", icon='black_and_white')
|
|
3232
3238
|
settings_frm = CreateLabelFrameWithIcon(parent=self.main_frm, header="SETTINGS", icon_name=Keys.DOCUMENTATION.value, icon_link=Links.VIDEO_TOOLS.value)
|
|
3233
3239
|
threshold = [round(x, 2) for x in list(np.arange(0.01, 1.01, 0.01))]
|
|
3234
|
-
|
|
3235
|
-
self.
|
|
3236
|
-
|
|
3237
|
-
self.threshold_dropdown.setChoices(0.5)
|
|
3238
|
-
self.gpu_dropdown.setChoices('FALSE')
|
|
3240
|
+
gpu_state = NORMAL if check_nvidea_gpu_available(raise_error=False) else DISABLED
|
|
3241
|
+
self.threshold_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=threshold, label="BLACK THRESHOLD:", label_width=25, dropdown_width=25, value=0.5, img='threshold')
|
|
3242
|
+
self.gpu_dropdown = SimBADropDown(parent=settings_frm, dropdown_options=['TRUE', 'FALSE'], label="USE GPU:", label_width=25, dropdown_width=25, value='FALSE', img='gpu_3', state=gpu_state, tooltip_key='USE_GPU')
|
|
3239
3243
|
settings_frm.grid(row=0, column=0, sticky=NW)
|
|
3240
3244
|
self.threshold_dropdown.grid(row=0, column=0, sticky=NW)
|
|
3241
3245
|
self.gpu_dropdown.grid(row=1, column=0, sticky=NW)
|
|
@@ -3258,8 +3262,8 @@ class Convert2BlackWhitePopUp(PopUpMixin):
|
|
|
3258
3262
|
#self.main_frm.mainloop()
|
|
3259
3263
|
|
|
3260
3264
|
def run(self, multiple: bool):
|
|
3261
|
-
threshold = float(self.threshold_dropdown.
|
|
3262
|
-
gpu = str_2_bool(self.gpu_dropdown.
|
|
3265
|
+
threshold = float(self.threshold_dropdown.get_value())
|
|
3266
|
+
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
3263
3267
|
if not multiple:
|
|
3264
3268
|
data_path = self.selected_video.file_path
|
|
3265
3269
|
check_file_exist_and_readable(file_path=data_path)
|
|
@@ -3384,7 +3388,7 @@ class ManualTemporalJoinPopUp(PopUpMixin):
|
|
|
3384
3388
|
unique_fps, unique_res = list(set(fps)), list(set(resolutions))
|
|
3385
3389
|
format = self.out_format_dropdown.getChoices()
|
|
3386
3390
|
quality = self.quality_dropdown.getChoices()
|
|
3387
|
-
gpu = str_2_bool(self.gpu_dropdown.
|
|
3391
|
+
gpu = str_2_bool(self.gpu_dropdown.get_value())
|
|
3388
3392
|
if len(unique_fps) > 1: raise FrameRangeError(msg=f'The selected videos contain more than one unique FPS: {unique_fps}', source=self.__class__.__name__)
|
|
3389
3393
|
if len(unique_res) > 1: raise ResolutionError(msg=f'The selected videos contain more than one unique resolutions: {unique_res}', source=self.__class__.__name__)
|
|
3390
3394
|
threading.Thread(temporal_concatenation(video_paths=video_file_paths,
|