<jupyter_start><jupyter_text><jupyter_code>import os
!ls
!git clone https://github.com/matterport/Mask_RCNN.git
!pwd
os.chdir('/content/Mask_RCNN/')

!git clone https://github.com/Waxpple/coco_model.git

#!git checkout https://github.com/Waxpple/coco_model.git



!pip3 install -r requirements.txt
!python3 setup.py install
os.chdir('/content/Mask_RCNN/coco_model/samples/')
!python3 hat.py train --dataset=/content/Mask_RCNN/coco_model/hat_dataset/ --weights=coco
#!rm -rf /content/Mask_RCNN/coco_model/
from google.colab import files
#files.download('/content/Mask_RCNN/coco_model/samples/mask_rcnn_coco.h5')
!zip -r /content/file.zip /content/Mask_RCNN

!git init
from google.colab import auth
from googleapiclient.http import MediaFileUpload
from googleapiclient.discovery import build

auth.authenticate_user()
drive_service = build('drive', 'v3')

def save_file_to_drive(name, path):

  file_metadata = {
      'name': name,
      'mimeType': 'application/octet-stream'
     }

  media = MediaFileUpload(path, 
                    mimetype='application/octet-stream',
                    resumable=True)

  created = drive_service.files().create(body=file_metadata,
                                   media_body=media,
                                   fields='id').execute()

  print('File ID: {}'.format(created.get('id')))

  return created
save_file_to_drive('123.zip', '/content/file.zip')
os.chdir('/content/Mask_RCNN/coco_model/samples/')
!python3 hat.py splash --weights=/content/Mask_RCNN/coco_model/samples/logs/hat20191114T1238/mask_rcnn_hat_0029.h5 --image=https://www.inquirer.com/resizer/x05kgLE-e5mNXIcdiZhcNVXziAI=/1400x932/smart/arc-anglerfish-arc2-prod-pmn.s3.amazonaws.com/public/HAE57BSLPBHFZBMFURODI36OHE.jpg
!ls
files.download('splash_20191114T150627.png')<jupyter_output>hat.py			    splash_20191114T143644.png
logs			    splash_20191114T144813.png
mask_rcnn_coco.h5	    splash_20191114T144908.png
splash_20191114T142744.png  splash_20191114T145033.png
splash_20191114T142923.png  splash_20191114T145333.png
splash_20191114T143422.png  splash_20191114T150439.png
splash_20191114T143538.png  splash_20191114T150627.png
{'fraction_non_alphanumeric': 0.11783884489986027, 'fraction_numerical': 0.09827666511411272, 'mean_word_length': 4.251833740831296, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '536805', 'license': 'Apache-2.0', 'n_tokens_mistral': 954, 'n_tokens_neox': 811, 'n_words': 101, 'path': 'Untitled12.ipynb', 'repo_name': 'Waxpple/Database', 'size': '2147'}