Print current state
This commit is contained in:
parent
61a6efe94e
commit
22c19d0729
@ -57,7 +57,7 @@ main :: IO ()
|
|||||||
main = do
|
main = do
|
||||||
Cmd{..} <- getRecord "Image duplicate finder"
|
Cmd{..} <- getRecord "Image duplicate finder"
|
||||||
-- XXX: This is a really long line, split it up
|
-- XXX: This is a really long line, split it up
|
||||||
fingerprints <- runSafeT (P.fold (\acc -> either (const acc) (\x -> x `seq` x : acc)) [] id (find source (glob "*.jpg" <> regular) >-> P.mapM (\path -> fmap (path,) <$> liftIO (readImage path)) >-> P.map (fmap (\(path, img) -> Fingerprint path (fingerprint img)))))
|
fingerprints <- runSafeT (P.fold (\acc -> either (const acc) (\x -> x `seq` x : acc)) [] id (find source (glob "*.jpg" <> regular) >-> P.mapM (\path -> liftIO (putStrLn path) >> fmap (path,) <$> liftIO (readImage path)) >-> P.map (fmap (\(path, img) -> Fingerprint path (fingerprint img)))))
|
||||||
let index = foldl' (flip BK.insert) BK.empty fingerprints
|
let index = foldl' (flip BK.insert) BK.empty fingerprints
|
||||||
forM_ fingerprints $ \fp -> do
|
forM_ fingerprints $ \fp -> do
|
||||||
let similar = BK.search 1 fp index
|
let similar = BK.search 1 fp index
|
||||||
|
Loading…
Reference in New Issue
Block a user