Manul, da
commited on
Commit
·
c416e51
1
Parent(s):
f47174e
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,15 +2,3 @@ import gradio as gr
|
|
| 2 |
import net
|
| 3 |
import start
|
| 4 |
|
| 5 |
-
def binary_to_int(binary_array):
|
| 6 |
-
# Reverse the array to start from the least significant bit
|
| 7 |
-
binary_array = np.flip(binary_array)
|
| 8 |
-
|
| 9 |
-
# Initialize the result
|
| 10 |
-
result = 0
|
| 11 |
-
|
| 12 |
-
# Iterate over the array and calculate the decimal value
|
| 13 |
-
for i, bit in enumerate(binary_array):
|
| 14 |
-
result += bit * (2 ** i)
|
| 15 |
-
|
| 16 |
-
return result
|
|
|
|
| 2 |
import net
|
| 3 |
import start
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|