.
This commit is contained in:
+3
-11
@@ -467,21 +467,13 @@ class RapidImage(models.Model):
|
|||||||
#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()
|
||||||
flat_array = list(dataset.pixel_array.astype(str).flatten())
|
for i in dataset.pixel_array.astype(str).flatten():
|
||||||
last_el = flat_array.pop()
|
|
||||||
for i in flat_array:
|
|
||||||
md5.update(f"{i},".encode())
|
md5.update(f"{i},".encode())
|
||||||
md5.update(last_el.encode())
|
print(0)
|
||||||
|
|
||||||
hash = md5.hexdigest()
|
hash = md5.hexdigest()
|
||||||
|
#----
|
||||||
|
|
||||||
print(1)
|
print(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user