Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,18 +73,18 @@ def predict_next_move(fen, stockfish):
|
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
-
def download_stockfish():
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
|
| 89 |
def process_image(image_path):
|
| 90 |
# Ensure output directory exists
|
|
@@ -172,7 +172,7 @@ def transform_string(input_str):
|
|
| 172 |
|
| 173 |
# Streamlit app
|
| 174 |
def main():
|
| 175 |
-
download_stockfish()
|
| 176 |
st.title("Chessboard Position Detection and Move Prediction")
|
| 177 |
|
| 178 |
# User uploads an image or captures it from their camera
|
|
@@ -263,7 +263,7 @@ def main():
|
|
| 263 |
|
| 264 |
# Initialize the Stockfish engine
|
| 265 |
stockfish = Stockfish(
|
| 266 |
-
path="stockfish-windows-x86-64-avx2.exe", # Replace with your Stockfish path"
|
| 267 |
depth=15,
|
| 268 |
parameters={"Threads": 2, "Minimum Thinking Time": 30}
|
| 269 |
)
|
|
|
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
+
# def download_stockfish():
|
| 77 |
+
# url = "https://drive.google.com/file/d/18pkwBVc13fgKP3LzrTHE4yzhjyGJexlR/view?usp=sharing" # Replace with the actual link
|
| 78 |
+
# file_name = "stockfish-windows-x86-64-avx2.exe"
|
| 79 |
+
|
| 80 |
+
# if not os.path.exists(file_name):
|
| 81 |
+
# print(f"Downloading {file_name}...")
|
| 82 |
+
# response = requests.get(url, stream=True)
|
| 83 |
+
# with open(file_name, "wb") as file:
|
| 84 |
+
# for chunk in response.iter_content(chunk_size=1024):
|
| 85 |
+
# if chunk:
|
| 86 |
+
# file.write(chunk)
|
| 87 |
+
# print(f"{file_name} downloaded successfully.")
|
| 88 |
|
| 89 |
def process_image(image_path):
|
| 90 |
# Ensure output directory exists
|
|
|
|
| 172 |
|
| 173 |
# Streamlit app
|
| 174 |
def main():
|
| 175 |
+
# download_stockfish()
|
| 176 |
st.title("Chessboard Position Detection and Move Prediction")
|
| 177 |
|
| 178 |
# User uploads an image or captures it from their camera
|
|
|
|
| 263 |
|
| 264 |
# Initialize the Stockfish engine
|
| 265 |
stockfish = Stockfish(
|
| 266 |
+
path="StockFish/stockfish-windows-x86-64-avx2.exe", # Replace with your Stockfish path"
|
| 267 |
depth=15,
|
| 268 |
parameters={"Threads": 2, "Minimum Thinking Time": 30}
|
| 269 |
)
|