Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
image-compression
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
image-compression
Commits
00cfa297
Commit
00cfa297
authored
Jun 23, 2022
by
Bryce Hepner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
turns out apparently doesn't work
parent
18e8282a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
RunningInParallel.py
RunningInParallel.py
+3
-4
No files found.
RunningInParallel.py
View file @
00cfa297
...
...
@@ -9,7 +9,7 @@ def initialize():
"""
client
=
Client
()
# Only works if a cluster is running.
dview
=
client
[:]
dview
.
execute
(
"from WorkingPyDemo import *"
)
#neede
d for others
dview
.
execute
(
"from WorkingPyDemo import *"
)
#needed for others
dview
.
block
=
True
return
dview
if
__name__
==
"__main__"
:
...
...
@@ -24,7 +24,7 @@ if __name__ == "__main__":
"""
Takes in the filename and writes the compressed image
"""
newnamesforlater
=
[]
list_dic
=
np
.
load
(
"first_dic.npy"
,
allow_pickle
=
True
)
bins
=
[
21
,
32
,
48
]
image
,
new_error
,
diff
=
huffman
(
filename
,
4
,
False
)
...
...
@@ -34,7 +34,6 @@ if __name__ == "__main__":
newname
=
filename
[:
-
5
]
else
:
newname
=
filename
[:
-
4
]
newnamesforlater
.
append
(
newname
+
"_Compressed.txt"
)
with
open
(
newname
+
"_Compressed.txt"
,
'wb'
)
as
f
:
f
.
write
(
inletters
)
def
decode_an_image
(
filename
):
...
...
@@ -47,6 +46,6 @@ if __name__ == "__main__":
newname
=
filename
[:
-
4
]
encoded_string2
=
bytes_to_bitstring
(
read_from_file
(
newname
+
"_Compressed.txt"
))
reconstruct_image
=
decoder
(
encoded_string2
,
list_dic
,
bins
,
False
)
dview
.
map_sync
(
save_an_image
,
images
[
160
:
20
0
])
dview
.
map_sync
(
save_an_image
,
images
[
0
])
# dview.map_sync(decode_an_image, images[0:6])
print
(
time
()
-
starttime
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment