.
This commit is contained in:
+13
-3
@@ -466,10 +466,20 @@ class RapidImage(models.Model):
|
|||||||
#pre_join = ",".join(flatten)
|
#pre_join = ",".join(flatten)
|
||||||
#print(pre_join)
|
#print(pre_join)
|
||||||
#hash = hashlib.md5(pre_join.encode()).hexdigest()
|
#hash = hashlib.md5(pre_join.encode()).hexdigest()
|
||||||
|
#----
|
||||||
|
#md5 = hashlib.md5()
|
||||||
|
#for i in dataset.pixel_array.flatten():
|
||||||
|
# md5.update(f"{str(i)},".encode())
|
||||||
|
#print(0)
|
||||||
|
|
||||||
|
#hash = md5.hexdigest()
|
||||||
|
#----
|
||||||
md5 = hashlib.md5()
|
md5 = hashlib.md5()
|
||||||
for i in dataset.pixel_array.flatten():
|
flat_array = list(dataset.pixel_array.astype(str).flatten())
|
||||||
md5.update(f"{str(i)},".encode())
|
last_el = flat_array.pop()
|
||||||
print(0)
|
for i in flat_array:
|
||||||
|
md5.update(f"{i},".encode())
|
||||||
|
md5.update(last_el.encode())
|
||||||
|
|
||||||
hash = md5.hexdigest()
|
hash = md5.hexdigest()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user