Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

SpindleNet #5

Closed
punkyoon opened this issue Sep 26, 2017 · 7 comments
Closed

SpindleNet #5

punkyoon opened this issue Sep 26, 2017 · 7 comments
Assignees

Comments

@punkyoon
Copy link
Member

punkyoon commented Sep 26, 2017

SpindleNet

@punkyoon
Copy link
Member Author

punkyoon commented Sep 26, 2017

Download large file from google drive using python script

from_google_drive.py

import requests

def download_file_from_google_drive(id, destination):
    def get_confirm_token(response):
        for key, value in list(response.cookies.items()):
            if key.startswith('download_warning'):
                return value

        return None

    def save_response_content(response, destination):
        CHUNK_SIZE = 32768

        with open(destination, "wb") as f:
            for chunk in response.iter_content(CHUNK_SIZE):
                if chunk: # filter out keep-alive new chunks
                    f.write(chunk)

    URL = "https://docs.google.com/uc?export=download"

    session = requests.Session()

    response = session.get(URL, params = { 'id' : id }, stream = True)
    token = get_confirm_token(response)

    if token:
        params = { 'id' : id, 'confirm' : token }
        response = session.get(URL, params = params, stream = True)
    save_response_content(response, destination)


if __name__ == "__main__":
    import sys
    if len(sys.argv) is not 3:
        print("Usage: python google_drive.py drive_file_id destination_file_path")
    else:
        # TAKE ID FROM SHAREABLE LINK
        file_id = sys.argv[1]
        # DESTINATION FILE ON YOUR DISK
        destination = sys.argv[2]
        download_file_from_google_drive(file_id, destination)

source code from stackoverflow

@punkyoon punkyoon self-assigned this Sep 26, 2017
@punkyoon
Copy link
Member Author

17.9.30 현재 SpindleNet/data/format_cuhk03.py에 심각한 문제가 발생하고 있다..

@punkyoon
Copy link
Member Author

punkyoon commented Sep 30, 2017

각 dataset의 폴더 이름

  • cuhk01: cuhk01
  • cuhk02: cuhk02
  • cuhk03: cuhk03_release
  • PRID: prid
  • psdb: psdb
  • VIPeR: VIPeR
  • 3DPeS: 3DPeS
  • Shinpuhkan: shinpuhkan
  • SenseReID: SenseReID
  • Market-1501: Market-1501-v15.09.15
  • I-LIDS: ilids

@juice500ml juice500ml reopened this Oct 2, 2017
@juice500ml
Copy link
Member

https://github.com/rbgirshick/fast-rcnn
그냥 caffe를 빌드하면 안되고 저 브랜치에 있는걸 빌드해야하네요.

train_head.sh 부터 쭉 에러납니다! (rbgirshick/py-faster-rcnn#579)

@punkyoon
Copy link
Member Author

punkyoon commented Oct 3, 2017

https://github.com/yokattame/caffe 에 있는 것을 cmake로 build 하기..^^;;

@punkyoon
Copy link
Member Author

punkyoon commented Oct 3, 2017

protobuf 3.3.0 버전이 설치된 것을 확인했지만, 스크립트를 실행할 때마다 protobuf 2.5 버전이 설치되어 있다고 나오면서 에러가 발생중이다..

==========================

python protobuf의 버전을 낮추면 된다...

local에 설치된 불쌍한 libprotoc-dev를 괴롭히지 말자............ 😢

@punkyoon
Copy link
Member Author

punkyoon commented Oct 4, 2017

SpindleNet Requirements

  1. Python 2.7
  2. Custom Caffe
  3. protobuf 2.5.0

sudo pip2 install protobuf==2.5.0

  1. opencv

sudo apt-get install libopencv-dev python-opencv

  1. libprotoc-dev 2.5.0

@punkyoon punkyoon closed this as completed Oct 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants