8

I came across a set of images (e.g., https://github.com/kehuantiantang/A-DNN-based-Semantic-Segmentation-for-Detecting-Weed-and-Crop/blob/master/stuttgart/stuttgart_cp_00000.npy) that are stored in the git lfs with the information like this:

version https://git-lfs.github.com/spec/v1
oid sha256:6692f38904c1ae21cd3d3e6e378538c07fda86fe97ee01d8664bb95fc20cd1de
size 8889498

How to view and download the original image file? I am new to Git LFS. Any one can give some detailed steps to follow?

Updates on what I did:

I downloaded the github repo: https://github.com/kehuantiantang/A-DNN-based-Semantic-Segmentation-for-Detecting-Weed-and-Crop

unzipped it to a folder, and cd to the subfolder stuttgart(here is what are included:https://github.com/kehuantiantang/A-DNN-based-Semantic-Segmentation-for-Detecting-Weed-and-Crop/tree/master/stuttgart),

type the command git lfs pull (via git bash win10), but got this error: "batch response:Rate limit exceeded: https://github.com/kehuantiantang/A-DNN-based-Semantic-Segmentation-for-Detecting-Weed-and-Crop.git/info/lfs/objects/batch error: failed to fetch some objects from 'https://github.com/kehuantiantang/A-DNN-based-Semantic-Segmentation-for-Detecting-Weed-and-Crop.git/info/lfs'

jwm
  • 4,832
  • 10
  • 46
  • 78
  • Make sure Git LFS is installed then run `git lfs init`, then `git lfs pull`. – jessehouwing Jan 06 '21 at 20:46
  • I am using git bash on Windows," $ git lfs install" shows "Git LFS initialized". Then the commands you give do not work in the bash. The "$ git lfs pull" gives the eror: "Not in a git repository". Could you expand a little bit your answer? – jwm Jan 06 '21 at 21:40
  • Have you cloned the repo? Or downloaded it as a zip? Make sure you clone the repo – jessehouwing Jan 06 '21 at 21:57
  • I provide the updates on what I did according to the command you suggested, but got the batch response error (see above). – jwm Jan 06 '21 at 22:16
  • Looks like there is something wrong with this repo. I'm trying to clone it and it's failing the same way on my end. – jessehouwing Jan 07 '21 at 09:29

4 Answers4

3

No need for oid sha256.

git lfs fetch git lfs checkout is ok.

amimibear
  • 31
  • 5
1

You can use

git log -p -S6692f38904c1ae21cd3d3e6e378538c07fda86fe97ee01d8664bb95fc20cd1de

to get the file path, then

git lfs fetch -I [filePath]
wcw
  • 21
  • 4
0

If this is in a repository, you should be able to run git lfs install on your system and then check out the files by using git lfs pull. In the future, LFS files will be pulled down automatically after you've run git lfs install once.

If it's not in a repository, then you'll have to find the LFS server and make your own API request to download it. The pointer file doesn't tell you anything about the server on which the LFS file is located, only the object that's being referenced.

0

1. First Install:

git lfs install

2. Fetch all LFS:

git lfs fetch --all

fetch: 3 object(s) found, done
fetch: Fetching all references...
Downloading LFS objects: 100% (3/3), 468 MB | 2.4 MB/s

3. Get object list:

git lfs ls-files --all

979bb1f94f - Path/dump-01-11-2022.sql
a0d4f0ef25 - Path/dump-01-06-2022.sql
c01c32ecf8 - Path/dump-01-10-2022.sql

4. Get SHA-256 OID:

git log --all -p -S a0d4f0ef25

commit bb6a2b3381bb2f2751cf9a6db679d99dc628f14c (tag: 3.14.98)
Author: Jhonny Cinco <jhonny@bolivia.tech>
Date:   Tue Jan 11 14:50:45 2022 -0400

     [LFS] Update sql script

5. Get file:

git checkout bb6a2b3381bb2f2751cf9a6db679d99dc628f14c

HEAD is now at bb6a2b3 [LFS] Update sql script