Kruk2/jasna
Video restoration tool
Python★ 2,546+115 that day#7 on trending
B71.1/100
Duplication75
3.5% in python, bash, cpp, c-header, perlDead code97
0.2%Complexity50
51.3% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
0.99%duplicated code · 524 of 53,192 lines
48clones in code
203code files of 501 scanned
3.33%duplicated over all files · 344 clones
Most complex files
- jasna/gui/segment_editor.py454 cx
- jasna/ltx/restore.py206 cx
- jasna/media/video_encoder.py200 cx
- jasna/gui/video_player.py191 cx
- jasna/gui/queue_panel.py189 cx
- tests/test_streaming.py177 cx
- jasna/media/splice.py160 cx
- jasna/ltx/plan.py158 cx
- jasna/main.py157 cx
- tests/test_segment_editor.py148 cx
Dead code 0.24% unused · 48 findings
- jasna/models/basicvsrpp/mmagic/img_utils.py:reorder_imageunused-export
- jasna/models/basicvsrpp/mmagic/img_utils.py:to_numpyunused-export
- jasna/models/basicvsrpp/mmagic/model_utils.py:build_moduleunused-export
- jasna/models/basicvsrpp/mmagic/model_utils.py:get_module_deviceunused-export
- jasna/models/basicvsrpp/mmagic/pixelwise_loss.py:tv_lossunused-export
- jasna/models/basicvsrpp/mmagic/registry.py:RUNNERSunused-export
- jasna/models/basicvsrpp/mmagic/registry.py:RUNNER_CONSTRUCTORSunused-export
- jasna/models/basicvsrpp/mmagic/registry.py:LOOPSunused-export
- jasna/models/basicvsrpp/mmagic/registry.py:HOOKSunused-export
- jasna/models/basicvsrpp/mmagic/registry.py:LOG_PROCESSORSunused-export
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 26 lines in 2 placespython265 tokens
12'int8': { 13 'top': { 14 'adaln_single.emb.timestep_embedder.linear_1.bias': ('BF16', (4096,)), 15 'adaln_single.emb.timestep_embedder.linear_1.weight': ('BF16', (4096, 256)), 16 'adaln_single.emb.timestep_embedder.linear_2.bias': ('BF16', (4096,)), 17 'adaln_single.emb.timestep_embedder.linear_2.weight': ('BF16', (4096, 4096)), 18 'adaln_single.linear.bias': ('BF16', (36864,)), 19 'adaln_single.linear.weight': ('BF16', (36864, 4096)), 20 'keyframes_abs_pos_embedding': ('BF16', (1, 4096)), 21 'patchify_proj.bias': ('BF16', (4096,)),First 10 of 26 lines.
- 32 lines in 2 placespython209 tokensjasna/models/basicvsrpp/mmagic/pixelwise_loss.py:81–112jasna/models/basicvsrpp/mmagic/pixelwise_loss.py:130–161
81 (argument of `forward()`) is not None. It will first reduce loss 82 with 'mean' per-sample, and then it means over all the samples. 83 Default: False. 84""" 85 86def __init__(self, 87 loss_weight: float = 1.0, 88 reduction: str = 'mean', 89 sample_wise: bool = False) -> None: 90 super().__init__()First 10 of 32 lines.
- 7 lines in 4 placespython66 tokensjasna/gui/settings_sections/advanced.py:25–31jasna/gui/settings_sections/basic.py:40–46jasna/gui/settings_sections/encoding.py:34–40jasna/gui/settings_sections/image_restoration.py:21–27
25section = CollapsibleSection(parent, t("section_advanced"), expanded=False) 26section.pack(fill="x", pady=(0, Sizing.PADDING_SMALL)) 27content = section.content 28content.configure(corner_radius=Sizing.BORDER_RADIUS) 29 30inner = ctk.CTkFrame(content, fg_color="transparent") 31inner.pack(fill="x", padx=Sizing.PADDING_MEDIUM, pady=Sizing.PADDING_MEDIUM)
7 more
- 21 lines in 2 placespython147 tokens
- 7 lines in 3 placespython71 tokens
- 6 lines in 3 placespython70 tokens
- 15 lines in 2 placespython130 tokens
- 14 lines in 2 placespython118 tokens
- 20 lines in 2 placespython117 tokens
- 19 lines in 2 placespython110 tokens
Largest clones over all files, tests and data included
- 11 lines in 5 placespythontests174 tokenstests/test_pipeline_run.py:558–568tests/test_pipeline_run.py:616–626tests/test_pipeline_run.py:664–674tests/test_pipeline_run.py:772–782tests/test_pipeline_run.py:823–833
558 bboxes=[np.array([1, 1, 5, 5], dtype=np.float32)] * 2, 559 masks=[torch.zeros((2, 2), dtype=torch.bool)] * 2, 560) 561pr = PrimaryRestoreResult( 562 track_id=clip.track_id, start_frame=clip.start_frame, 563 frame_count=2, frame_shape=(8, 8), frame_device=torch.device("cpu"), 564 masks=clip.masks, primary_raw=torch.zeros((2, 3, 256, 256)), 565 keep_start=0, keep_end=2, crossfade_weights=None, 566 enlarged_bboxes=[(1, 1, 5, 5)] * 2, crop_shapes=[(4, 4)] * 2, 567 pad_offsets=[(126, 126)] * 2, resize_shapes=[(4, 4)] * 2,First 10 of 11 lines.
- 30 lines in 3 placespythontests303 tokenstests/test_pipeline_run.py:438–467tests/test_pipeline_run.py:488–517tests/test_pipeline_run_sync.py:266–297
438batches = [(frames_t, [0, 1])] 439reader_cls, _, _ = _make_two_readers(batches) 440 441mock_encoder = MagicMock() 442mock_encoder.__enter__ = MagicMock(return_value=mock_encoder) 443mock_encoder.__exit__ = MagicMock(return_value=False) 444 445clip = TrackedClip( 446 track_id=1, start_frame=0, mask_resolution=(2, 2), 447 bboxes=[np.array([1, 1, 5, 5], dtype=np.float32)] * 2,First 10 of 30 lines.
- 60 lines in 2 placespythontests474 tokens
255p = _make_pipeline() 256 257frames_t = torch.randint(0, 256, (2, 3, 8, 8), dtype=torch.uint8) 258batches = [(frames_t, [0, 1])] 259reader_cls, _, _ = _make_two_readers(batches) 260 261mock_encoder = MagicMock() 262mock_encoder.__enter__ = MagicMock(return_value=mock_encoder) 263mock_encoder.__exit__ = MagicMock(return_value=False) 264First 10 of 60 lines.
- 38 lines in 2 placespythontests381 tokens
- 41 lines in 2 placespythontests369 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 185 | 51,351 | 47 | 518 | 1.01% |
| cpp | 2 | 647 | 1 | 6 | 0.93% |
| bash | 11 | 791 | 0 | 0 | 0% |
| c-header | 4 | 235 | 0 | 0 | 0% |
| perl | 1 | 168 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 376 | 97,682 | 322 | 3,469 | 3.55% |
| bash | 30 | 944 | 13 | 73 | 7.73% |
| markdown | 54 | 5,395 | 5 | 32 | 0.59% |
| txt | 7 | 2,422 | 2 | 12 | 0.5% |
| cpp | 2 | 647 | 1 | 6 | 0.93% |
| diff | 1 | 54 | 1 | 7 | 12.96% |
| csv | 24 | 412 | 0 | 0 | 0% |
| c-header | 4 | 235 | 0 | 0 | 0% |
| perl | 1 | 168 | 0 | 0 | 0% |
| toml | 1 | 96 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 19, 2026 | #7 | 2,546 (+115) | 501 | 108,096 | 344 | 3.33% | 0.99% | B 71.1 | 099af50 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.