some refinement

This commit is contained in:
Fisher Wang committed 2021-03-12 22:29:45 +08:00
1 parent 8527c7c83c
commit 589e79f78a
3 files changed
+9 -9

No files matched your search

@@ -680,9 +680,9 @@ print(F)
```python ```python
# Author: Fisher Wang # Author: Fisher Wang
w, h = 16, 16 w, h = 256, 256
img = np.random.randint(0, 256, (w, h, 3)).astype(np.ubyte) I = np.random.randint(0, 4, (w, h, 3)).astype(np.ubyte)
colors = np.unique(img.reshape(-1, 3), axis=0) colors = np.unique(I.reshape(-1, 3), axis=0)
n = len(colors) n = len(colors)
print(n) print(n)
``` ```
+3 -3
View File
@@ -680,9 +680,9 @@ print(F)
```python ```python
# Author: Fisher Wang # Author: Fisher Wang
w, h = 16, 16 w, h = 256, 256
img = np.random.randint(0, 256, (w, h, 3)).astype(np.ubyte) I = np.random.randint(0, 4, (w, h, 3)).astype(np.ubyte)
colors = np.unique(img.reshape(-1, 3), axis=0) colors = np.unique(I.reshape(-1, 3), axis=0)
n = len(colors) n = len(colors)
print(n) print(n)
``` ```
+3 -3
View File
@@ -863,9 +863,9 @@ hint: np.unique
< a66 < a66
# Author: Fisher Wang # Author: Fisher Wang
w, h = 16, 16 w, h = 256, 256
img = np.random.randint(0, 256, (w, h, 3)).astype(np.ubyte) I = np.random.randint(0, 4, (w, h, 3)).astype(np.ubyte)
colors = np.unique(img.reshape(-1, 3), axis=0) colors = np.unique(I.reshape(-1, 3), axis=0)
n = len(colors) n = len(colors)
print(n) print(n)