Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/msrtc_rans/include/msrtc_rans/EntropyCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions packages/msrtc_rans/private/include/msrtc_rans/rans.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
{
Expand Down Expand Up @@ -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 <typename StateType, typename UnitType, typename Sink>
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/msrtc_rans/python/cpp/PyWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/msrtc_rans/python/src/msrtc/rans/_msrtc_rans.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ class RansDecoderStream:

EntropyEncoder = Any
"""
Entropy encoder implmentation
Entropy encoder implementation
"""

EntropyDecoder = Any
"""
Entropy decoder implmentation
Entropy decoder implementation
"""
2 changes: 1 addition & 1 deletion video/compare_rd_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion video/src/metrics/msssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion video/src/models/entropy_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion video/src/utils/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions video/src/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -279,7 +279,7 @@ def configure_logging(

def multiprocessing_init():
"""
Multiprocessing intitialization
Multiprocessing initialization
"""
import torch.multiprocessing as mp

Expand Down
2 changes: 1 addition & 1 deletion video/src/utils/distributed/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion video/src/utils/encoder_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion video/src/utils/video_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions video/train_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down