Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Image classification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Audard Lucile
Image classification
Compare revisions
4f54d585fee76b944afbdc9e8c7daf3044177db4 to 8047c92f712a910c77b57d9350391fe4773bccad
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
laudard/image-classification
Select target project
No results found
8047c92f712a910c77b57d9350391fe4773bccad
Select Git revision
Branches
main
1 result
Swap
Target
laudard/image-classification
Select target project
laudard/image-classification
1 result
4f54d585fee76b944afbdc9e8c7daf3044177db4
Select Git revision
Branches
main
1 result
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
4
Create .gitignore
· e4c7026c
Audard Lucile
authored
Oct 20, 2023
e4c7026c
Update .gitignore
· e6bb3b4a
Audard Lucile
authored
Oct 20, 2023
e6bb3b4a
Create read_cifar.py
· e8b65f8d
Audard Lucile
authored
Oct 20, 2023
e8b65f8d
Update read_cifar.py
· 8047c92f
Audard Lucile
authored
Oct 22, 2023
8047c92f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+164
-0
164 additions, 0 deletions
.gitignore
read_cifar.py
+29
-0
29 additions, 0 deletions
read_cifar.py
with
193 additions
and
0 deletions
.gitignore
0 → 100644
View file @
8047c92f
/data
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
This diff is collapsed.
Click to expand it.
read_cifar.py
0 → 100644
View file @
8047c92f
import
pickle
import
numpy
as
np
def
unpickle
(
file
):
with
open
(
file
,
'
rb
'
)
as
fo
:
batch
=
pickle
.
load
(
fo
,
encoding
=
'
bytes
'
)
return
batch
def
read_cifar_batch
(
path
):
batch
=
unpickle
(
path
)
data
=
batch
[
b
'
data
'
]
labels
=
batch
[
b
'
labels
'
]
return
np
.
float32
(
data
),
np
.
int64
(
labels
)
def
read_cifar
(
folder_path
):
data
,
labels
=
read_cifar_batch
(
"
./data/cifar-10-python.tar/cifar-10-batches-py~/cifar-10-batches-py/test_batch
"
)
for
i
in
range
(
1
,
5
):
data
=
np
.
concatenate
((
data
,
read_cifar_batch
(
folder_path
+
"
/data_batch_
"
+
str
(
i
))[
0
]))
labels
=
np
.
concatenate
((
labels
,
read_cifar_batch
(
folder_path
+
"
/data_batch_
"
+
str
(
i
))[
1
]))
return
data
,
labels
if
__name__
==
"
__main__
"
:
data
,
labels
=
read_cifar
(
"
./data/cifar-10-python.tar/cifar-10-batches-py~/cifar-10-batches-py
"
)
print
(
data
)
print
(
labels
)
This diff is collapsed.
Click to expand it.