Skip to content

Commit 7e26e9f

Browse files
committed
[CI] Add caching for MNIST test dataset and improve download process
1 parent 94f0b83 commit 7e26e9f

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,25 @@ jobs:
233233
python parser.py
234234
cd ../..
235235
236+
- name: Cache MNIST test dataset
237+
id: cache-mnist
238+
uses: actions/cache@v4
239+
with:
240+
path: docs/mnist/mnist/test
241+
key: mnist-dataset-e2d09c892023700f68bfa9f30ac91a4dffaa23b151deeaca627101b3d73ef83d
242+
236243
- name: Download MNIST test dataset
244+
if: steps.cache-mnist.outputs.cache-hit != 'true'
237245
run: |
246+
set -e
238247
mkdir -p docs/mnist/mnist/test
239-
if [ ! -f "docs/mnist/mnist/test/0_000000.png" ]; then
240-
echo "Downloading test images..."
241-
wget -q https://github.com/DeepTrackAI/MNIST_dataset/archive/main.zip
242-
unzip -q main.zip
243-
cp MNIST_dataset-main/mnist/test/*.png docs/mnist/mnist/test/
244-
rm -rf main.zip MNIST_dataset-main
245-
echo "Downloaded $(ls docs/mnist/mnist/test | wc -l) images"
246-
fi
248+
echo "Downloading test images..."
249+
wget -q https://github.com/DeepTrackAI/MNIST_dataset/archive/main.zip -O main.zip
250+
echo "e2d09c892023700f68bfa9f30ac91a4dffaa23b151deeaca627101b3d73ef83d main.zip" | sha256sum -c -
251+
unzip -q main.zip
252+
cp MNIST_dataset-main/mnist/test/*.png docs/mnist/mnist/test/
253+
rm -rf main.zip MNIST_dataset-main
254+
echo "Downloaded $(ls docs/mnist/mnist/test | wc -l) images"
247255
248256
- name: Download binary and libs
249257
uses: actions/download-artifact@v4
@@ -262,16 +270,14 @@ jobs:
262270
run: |
263271
echo "### Library verification ###"
264272
file build/bin/opencv_libs/libopencv_imgcodecs.so.4.9.0 | grep "shared object"
265-
ldd build/bin/opencv_libs/libopencv_imgcodecs.so.4.9.0 || true
266-
realpath build/bin/opencv_libs/libopencv_imgcodecs.so.409
267273
268274
- name: Run evaluation
269275
run: |
270276
echo "### Pre-run checks ###"
271277
export LD_LIBRARY_PATH=$PWD/build/bin/opencv_libs:/usr/lib/x86_64-linux-gnu
272278
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
273279
274-
LD_DEBUG=files ./build/bin/ACC_MNIST* 2> ld_debug.log || true
280+
LD_DEBUG=files ./build/bin/ACC_MNIST* 2> ld_debug.log
275281
echo "### Library loading debug ###"
276282
grep -i "opencv_imgcodecs" ld_debug.log
277283

app/ReaderImage/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
file(MAKE_DIRECTORY "${OPENCV_BUILD_DIR}")
2-
31
set(INCLUDE_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/reader_img.hpp")
42
set(SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/reader_img_s.cpp")
53
add_library(ReadLib STATIC ${INCLUDE_HEADERS} ${SRC_FILES})

0 commit comments

Comments
 (0)