Upload folder using huggingface_hub
Browse files- README.md +53 -13
- requirements.txt +7 -0
- scripts/slim/tst.py +1 -1
README.md
CHANGED
|
@@ -219,32 +219,72 @@ python train_image_classifier.py --train_dir=${TRAIN_DIR} --dataset_name=embryo
|
|
| 219 |
<p align="justify">
|
| 220 |
6. The trained algorithms should be tested using test set images. In folder "AI-ML-Project-Embryo-Analysis-to-Improve-Success-Rate-of-IVF/scripts/slim", predict.py loads a trained model on provided test images. This code needs 5 arguments
|
| 221 |
|
| 222 |
-
```
|
| 223 |
-
$ python predict.py v1 ../result/ ../../Images/test output.txt 2
|
| 224 |
-
```
|
| 225 |
|
| 226 |
-
- v1 = inception-v1, ../Images/test = the address of test set images, output.txt = the output result file, 2 = number of classes
|
| 227 |
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
</p>
|
| 230 |
|
| 231 |
<p align="justify">
|
| 232 |
-
|
|
|
|
| 233 |
|
| 234 |
-
|
|
|
|
|
|
|
| 235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
</p>
|
| 237 |
|
| 238 |
-
<
|
| 239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
</p>
|
| 241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
<p align="justify">
|
| 243 |
-
|
| 244 |
</p>
|
| 245 |
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
✤ <i>This was the final project for the course B016 - Data Analytics for Business(May 2021), at <a href="https://www.stclaircollege.ca/">St. Clair College</a><i>
|
|
|
|
|
|
| 219 |
<p align="justify">
|
| 220 |
6. The trained algorithms should be tested using test set images. In folder "AI-ML-Project-Embryo-Analysis-to-Improve-Success-Rate-of-IVF/scripts/slim", predict.py loads a trained model on provided test images. This code needs 5 arguments
|
| 221 |
|
|
|
|
|
|
|
|
|
|
| 222 |
|
|
|
|
| 223 |
|
| 224 |
+
<a name="Steps_To_Follow"/>
|
| 225 |
+
|
| 226 |
+
<h2 id="Steps_To_Follow"> :arrow_right: Steps To Follow</h2>
|
| 227 |
+
|
| 228 |
+
<p align="justify">
|
| 229 |
+
To quickly test if the embryo classification model is working, please follow these simplified steps:
|
| 230 |
</p>
|
| 231 |
|
| 232 |
<p align="justify">
|
| 233 |
+
1. **Install Conda:** If you don't have Conda installed, follow the instructions for your operating system from the official Conda website: [https://docs.conda.io/en/latest/miniconda.html](https://docs.conda.io/en/latest/miniconda.html)
|
| 234 |
+
</p>
|
| 235 |
|
| 236 |
+
<p align="justify">
|
| 237 |
+
2. **Create and Activate Conda Environment:** Open your terminal or Anaconda prompt and run the following commands to create a new conda environment named `embryo-env` with Python 3.7 and activate it:
|
| 238 |
+
</p>
|
| 239 |
|
| 240 |
+
<pre>
|
| 241 |
+
conda create -n embryo-env python=3.7
|
| 242 |
+
conda init # Initialize conda for your shell (you might need to restart your terminal after this)
|
| 243 |
+
conda activate embryo-env
|
| 244 |
+
</pre>
|
| 245 |
+
|
| 246 |
+
<p align="justify">
|
| 247 |
+
3. **Install Dependencies:** Navigate to the root directory of the project (where `requirements.txt` is located) in your terminal and install the required Python packages using pip:
|
| 248 |
</p>
|
| 249 |
|
| 250 |
+
<pre>
|
| 251 |
+
pip install -r requirements.txt
|
| 252 |
+
</pre>
|
| 253 |
+
|
| 254 |
+
<p align="justify">
|
| 255 |
+
4. **Change Directory to `slim`:** Navigate to the `slim` directory within the `ivf/scripts` folder:
|
| 256 |
</p>
|
| 257 |
|
| 258 |
+
<pre>
|
| 259 |
+
cd ivf/scripts/slim
|
| 260 |
+
</pre>
|
| 261 |
+
|
| 262 |
<p align="justify">
|
| 263 |
+
5. **Run the Test Script:** Execute the `tst.py` script to test the model with a sample image. This script is designed for a quick check to see if the model is functioning:
|
| 264 |
</p>
|
| 265 |
|
| 266 |
+
<pre>
|
| 267 |
+
python tst.py
|
| 268 |
+
</pre>
|
| 269 |
+
|
| 270 |
+
<p align="justify">
|
| 271 |
+
6. **Test with Different Images (Optional):** To test the model with different embryo images, open the `tst.py` file in a text editor. Locate the line that calls the `predict_image_label` function. It should look something like this:
|
| 272 |
+
</p>
|
| 273 |
+
|
| 274 |
+
<pre>
|
| 275 |
+
from pred import predict_image_label
|
| 276 |
+
print("**************",predict_image_label("result","../../Images/test/good_23765483_-15_3AA.jpg","v1",),"**************")
|
| 277 |
+
</pre>
|
| 278 |
|
| 279 |
+
<p align="justify">
|
| 280 |
+
Modify the image path within the `predict_image_label` function call to point to a different embryo image you want to test. Ensure the path is correct relative to the `slim` directory. For example, to test another image in the `Images/test` directory, you would change the path accordingly. Save the `tst.py` file after making changes and run `python tst.py` again.
|
| 281 |
+
</p>
|
| 282 |
+
|
| 283 |
+
<p align="justify">
|
| 284 |
+
7. **Understand the Output:** The `tst.py` script will print output to the console. The output is designed to show the prediction result for the image you tested. It will likely display probabilities or a classification (e.g., "good" or "poor") indicating the model's assessment of the embryo quality for the given image. Examine the printed output to verify if the model is providing predictions.
|
| 285 |
+
</p>
|
| 286 |
+
|
| 287 |
+
<br>
|
| 288 |
+
<br>
|
| 289 |
✤ <i>This was the final project for the course B016 - Data Analytics for Business(May 2021), at <a href="https://www.stclaircollege.ca/">St. Clair College</a><i>
|
| 290 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
protobuf==3.20.0
|
| 2 |
+
tensorflow==1.15
|
| 3 |
+
numpy
|
| 4 |
+
Keras
|
| 5 |
+
matplotlib
|
| 6 |
+
scikit-image
|
| 7 |
+
tf-slim
|
scripts/slim/tst.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
from pred import predict_image_label
|
| 2 |
-
print("**************",predict_image_label("result","../../Images/test/good_23765483_-15_3AA.jpg","v1",))
|
|
|
|
| 1 |
from pred import predict_image_label
|
| 2 |
+
print("**************",predict_image_label("result","../../Images/test/good_23765483_-15_3AA.jpg","v1",),"**************")
|