From 041799c0afbcf9d880a14855ed07194c567255de Mon Sep 17 00:00:00 2001 From: Anton Kesy Date: Thu, 30 Jul 2026 10:09:58 +0200 Subject: [PATCH] Fix typos --- packages/msrtc_rans/include/msrtc_rans/EntropyCoder.h | 2 +- packages/msrtc_rans/private/include/msrtc_rans/rans.h | 8 ++++---- packages/msrtc_rans/python/cpp/PyWrapper.h | 2 +- packages/msrtc_rans/python/src/msrtc/rans/_msrtc_rans.pyi | 4 ++-- video/compare_rd_video.py | 2 +- video/src/metrics/msssim.py | 2 +- video/src/models/entropy_models.py | 2 +- video/src/utils/app.py | 2 +- video/src/utils/common.py | 4 ++-- video/src/utils/distributed/operations.py | 2 +- video/src/utils/encoder_tester.py | 2 +- video/src/utils/video_writer.py | 2 +- video/train_video.py | 4 ++-- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/msrtc_rans/include/msrtc_rans/EntropyCoder.h b/packages/msrtc_rans/include/msrtc_rans/EntropyCoder.h index ba9cc0e..23ec96b 100644 --- a/packages/msrtc_rans/include/msrtc_rans/EntropyCoder.h +++ b/packages/msrtc_rans/include/msrtc_rans/EntropyCoder.h @@ -3,7 +3,7 @@ /** * @file msrtc_rans/entropy_coder.h - * @brief Defines msrtc_rans::EntropyEncoder and msrtc_rans::EntropyDecoder - entropy encoder and decoder using rANS alogirthm + * @brief Defines msrtc_rans::EntropyEncoder and msrtc_rans::EntropyDecoder - entropy encoder and decoder using rANS algorithm */ #pragma once diff --git a/packages/msrtc_rans/private/include/msrtc_rans/rans.h b/packages/msrtc_rans/private/include/msrtc_rans/rans.h index f58c1b0..f2dc62a 100644 --- a/packages/msrtc_rans/private/include/msrtc_rans/rans.h +++ b/packages/msrtc_rans/private/include/msrtc_rans/rans.h @@ -3,7 +3,7 @@ /** * @file msrtc_rans/rans.h - * @brief Defines raw primitives of rANS alogirthm + * @brief Defines raw primitives of rANS algorithm */ #pragma once @@ -25,7 +25,7 @@ using rans_freq_t = uint32_t; namespace details { -// 64-bit numbers multiplication outputing high 64-bit +// 64-bit numbers multiplication outputting high 64-bit #if defined(_MSC_VER) static inline uint64_t Mul64Hi(uint64_t a, uint64_t b) { @@ -80,7 +80,7 @@ struct RansEncSymbol { RansEncSymbol(freq_t start, freq_t freq, freq_t scale_bits); }; -// Raw rANS alogirthm encoder +// Raw rANS algorithm encoder // Sink need to define: // - operator(unit_t) for writing next unit template @@ -291,7 +291,7 @@ struct RansDecSymbol { RansDecSymbol(freq_t start, freq_t freq) : m_freq(freq), m_start(start) { assert(freq > 0); } }; -// Raw rANS alogirthm decoder +// Raw rANS algorithm decoder // Source needs to define: // - operator(unit_t&) for reading next unit // - OnOK() for reporting advancing to next symbol diff --git a/packages/msrtc_rans/python/cpp/PyWrapper.h b/packages/msrtc_rans/python/cpp/PyWrapper.h index ed19134..c99d198 100644 --- a/packages/msrtc_rans/python/cpp/PyWrapper.h +++ b/packages/msrtc_rans/python/cpp/PyWrapper.h @@ -34,7 +34,7 @@ namespace PyWrapper { -// Marker to contruct a reference to new object +// Marker to construct a reference to new object struct NewRef {}; // Simplistic implementation of reference counting pointer to python object diff --git a/packages/msrtc_rans/python/src/msrtc/rans/_msrtc_rans.pyi b/packages/msrtc_rans/python/src/msrtc/rans/_msrtc_rans.pyi index 82c71a2..41d3fd5 100644 --- a/packages/msrtc_rans/python/src/msrtc/rans/_msrtc_rans.pyi +++ b/packages/msrtc_rans/python/src/msrtc/rans/_msrtc_rans.pyi @@ -83,10 +83,10 @@ class RansDecoderStream: EntropyEncoder = Any """ -Entropy encoder implmentation +Entropy encoder implementation """ EntropyDecoder = Any """ -Entropy decoder implmentation +Entropy decoder implementation """ diff --git a/video/compare_rd_video.py b/video/compare_rd_video.py index 4cb850b..39d622e 100644 --- a/video/compare_rd_video.py +++ b/video/compare_rd_video.py @@ -307,7 +307,7 @@ def __init__( base_method_name = args.base_method assert len(args.log_paths) % 2 == 0, ( - "log paths shoud include both the method name and the corresponding log path" + "log paths should include both the method name and the corresponding log path" ) log_paths = {} for i in range(len(args.log_paths) // 2): diff --git a/video/src/metrics/msssim.py b/video/src/metrics/msssim.py index 96056a9..c8b615f 100644 --- a/video/src/metrics/msssim.py +++ b/video/src/metrics/msssim.py @@ -29,7 +29,7 @@ def __init__(self, *, channels=1, data_range=1): C2 = (0.03 * data_range) ** 2 self.register_buffer("_C", torch.asarray((C1, C2), dtype=torch.float)) - # scale weigths + # scale weights self.register_buffer("_weight5", torch.asarray((0.0448, 0.2856, 0.3001, 0.2363, 0.1333), dtype=torch.float)) # scale weights for small images according to HM implementation self.register_buffer("_weight4", torch.asarray((0.0517, 0.3295, 0.3462, 0.2726), dtype=torch.float)) diff --git a/video/src/models/entropy_models.py b/video/src/models/entropy_models.py index 832c18a..3465466 100644 --- a/video/src/models/entropy_models.py +++ b/video/src/models/entropy_models.py @@ -377,7 +377,7 @@ def _cdf2(inputs): def get_laplace_prob(values, scales): # noinspection PyUnusedLocal def _cdf(inputs): - # this is the original function of cdf, but we only care diffence of cdf + # this is the original function of cdf, but we only care difference of cdf return 0.5 + 0.5 * torch.sign(inputs) * (1.0 - torch.exp(-torch.abs(inputs))) def _cdf2(inputs): diff --git a/video/src/utils/app.py b/video/src/utils/app.py index 349f74f..92d99df 100644 --- a/video/src/utils/app.py +++ b/video/src/utils/app.py @@ -1298,7 +1298,7 @@ def optimizer_step(self): min_grad_scale = self.get_config_by_path("train.min_grad_scale", default=0, expected_type=numbers.Number) if min_grad_scale > 0: - # sync scale value to garantee all ranks skip or process batch + # sync scale value to guarantee all ranks skip or process batch if self.world_size > 1: grad_scale_tensor = torch.tensor(grad_scale, dtype=torch.float64, device=self.device) torch.distributed.broadcast(grad_scale_tensor, src=0) diff --git a/video/src/utils/common.py b/video/src/utils/common.py index 07c9af8..07c4ceb 100644 --- a/video/src/utils/common.py +++ b/video/src/utils/common.py @@ -242,7 +242,7 @@ def dump_json(obj, fid, float_digits=-1, **kwargs): # noinspection PyShadowingNames def inner(*args, **kwargs): args = list(args) - # fifth argument is float formater which we will replace + # fifth argument is float formatter which we will replace args[4] = lambda o: format(o, ".%df" % float_digits) return of(*args, **kwargs) @@ -279,7 +279,7 @@ def configure_logging( def multiprocessing_init(): """ - Multiprocessing intitialization + Multiprocessing initialization """ import torch.multiprocessing as mp diff --git a/video/src/utils/distributed/operations.py b/video/src/utils/distributed/operations.py index 7ecb505..0bd59e6 100644 --- a/video/src/utils/distributed/operations.py +++ b/video/src/utils/distributed/operations.py @@ -70,7 +70,7 @@ def run_distributed( ): if task_processor is not None: if list_processor is not None: - raise ValueError("Can not have both task and list processors sepcified") + raise ValueError("Can not have both task and list processors specified") list_processor = functools.partial(run_task_list, task_processor=task_processor) diff --git a/video/src/utils/encoder_tester.py b/video/src/utils/encoder_tester.py index 60d6f71..21d93c8 100644 --- a/video/src/utils/encoder_tester.py +++ b/video/src/utils/encoder_tester.py @@ -1456,7 +1456,7 @@ def _build_task_list(self, testset_desc_filename: str, *, testset_root: Optional elif decoder_format == "mp4": decoder_ext = ".mp4" else: - raise ValueError(f"Unsuppoted decoder_format {decoder_format}") + raise ValueError(f"Unsupported decoder_format {decoder_format}") for seq_name, seq_desc in dataset_desc["sequences"].items(): intra_period = params.intra_period diff --git a/video/src/utils/video_writer.py b/video/src/utils/video_writer.py index 63107f8..5e80b38 100644 --- a/video/src/utils/video_writer.py +++ b/video/src/utils/video_writer.py @@ -58,7 +58,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): class FrameFormatAdapter: def __init__(self, dst_format, bit_depth=8): if dst_format not in ("420", "444", "rgb"): - raise ValueError(f"Unspported dst format: {dst_format}") + raise ValueError(f"Unsupported dst format: {dst_format}") self.dst_format = dst_format if 8 < bit_depth <= 16: diff --git a/video/train_video.py b/video/train_video.py index 699372a..0609920 100644 --- a/video/train_video.py +++ b/video/train_video.py @@ -169,7 +169,7 @@ def _initialize_pretrained_part(self, model, part_name, config_path, module_name if pretrain_path is None: return False - logging.info(f"loading {part_name} weigths from {pretrain_path}") + logging.info(f"loading {part_name} weights from {pretrain_path}") state = get_state_dict(pretrain_path) for prefix in getattr(model, module_names_attr): module = getattr(model, prefix) @@ -662,7 +662,7 @@ def _create_optic_flow_loss(self): self.get_config_by_path("train.optic_flow_loss_path"), default_source="checkpoints_mount" ) - logging.info(f"loading optic flow loss weigths from {optic_flow_path}") + logging.info(f"loading optic flow loss weights from {optic_flow_path}") from src.models.spynet import ME_Spynet