Skip to content

Commit 5b92c95

Browse files
authored
Merge pull request #13 from scicloj/fastai-linalg-4
Fastai linalg 4
2 parents d3423d1 + 420c2b9 commit 5b92c95

File tree

1 file changed

+11
-10
lines changed
  • projects/math/numerical-linalg/notebooks

1 file changed

+11
-10
lines changed

projects/math/numerical-linalg/notebooks/svd.clj

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@
5454
;; frame and convert it to an image:
5555

5656
(def first-image
57-
(reduce (fn [_ frame] (clj-media.model/image
58-
frame))
59-
nil
60-
(clj-media/frames
61-
(clj-media/file video-path)
62-
:video
63-
{:format (clj-media/video-format
64-
{:pixel-format
65-
:pixel-format/rgba})})))
57+
(first
58+
(into []
59+
(comp (take 1)
60+
(map clj-media.model/image))
61+
(clj-media/frames
62+
(clj-media/file video-path)
63+
:video
64+
{:format (clj-media/video-format
65+
{:pixel-format
66+
:pixel-format/rgba})}))))
6667

6768
first-image
6869

@@ -86,7 +87,7 @@ first-image
8687
;; the images to a lower resolution, and
8788
;; turn them to gray-scale.
8889

89-
;; See [Luma](https://en.wikipedia.org/wiki/Luma_(video)
90+
;; See [Luma](https://en.wikipedia.org/wiki/Luma_(video))
9091
;; for discussion of the gray-scale formula:
9192
;; 0.299 ∙ Red + 0.587 ∙ Green + 0.114 ∙ Blue
9293

0 commit comments

Comments
 (0)