text stringlengths 1 93.6k |
|---|
wx.CallAfter(self.UpdateProgressRange, 159)
|
diskdump = bytearray()
|
self.fxio.setioreq(self.getioreq(drive))
|
for track in range(0, 160):
|
wx.CallAfter(self.UpdateProgressValue, track)
|
cyl = track // 2
|
side = track % 2
|
if self.abort.is_set():
|
wx.CallAfter(self.UpdateStatus, "UserStop.")
|
print("\nUser stopped.")
|
self.fxio.motoroff()
|
wx.CallAfter(self.Stop)
|
return
|
print(f'Reading Cyl:{cyl:02} Side:{side}', end='\r', flush=True)
|
wx.CallAfter(self.UpdateTrack, cyl, side, "Read")
|
self.fxio.settrack(track)
|
retry = 0
|
while ioerr := self.fxio.trackread():
|
if ioerr == self.fxio.TDERR_DiskChanged:
|
wx.CallAfter(self.UpdateStatus, "NoFloppy?")
|
print("\nTDERR_DiskChanged.")
|
self.fxio.motoroff()
|
wx.CallAfter(self.Stop)
|
return
|
else:
|
wx.CallAfter(self.UpdateStatus, f"{ioerr:02X}h Try#{retry}")
|
print(f'Read IO ERROR {ioerr:02X}h @ Cyl:{cyl:02} Side:{side}')
|
retry += 1
|
if retry > self.disk2adfmaxretries:
|
wx.CallAfter(self.UpdateStatus, f"RdErr: {ioerr:02X}h")
|
print("Track retry limit exceeded. Giving up.")
|
self.fxio.motoroff()
|
wx.CallAfter(self.Stop)
|
return
|
print(f'retry {retry} of {self.disk2adfmaxretries}...')
|
if self.abort.is_set():
|
wx.CallAfter(self.UpdateStatus, "UserStop.")
|
print("\nUser stopped.")
|
self.fxio.motoroff()
|
wx.CallAfter(self.Stop)
|
return
|
wx.CallAfter(self.UpdateTrack, cyl, side, "Xfer")
|
trackdump = self.fxio.recvbuffer()
|
if verify:
|
wx.CallAfter(self.UpdateStatus, "CRC")
|
amigacrc = self.fxio.callusr()
|
wx.CallAfter(self.UpdateCrc, amigacrc)
|
if amigacrc != self.snip.keysum(trackdump):
|
wx.CallAfter(self.UpdateStatus, "XFerCRCErr.")
|
print("\nXFER CRC ERROR.")
|
self.fxio.motoroff()
|
wx.CallAfter(self.Stop)
|
diskdump += trackdump
|
wx.CallAfter(self.UpdateTrack, 0, 0, "Seek")
|
self.fxio.settrack(0)
|
self.fxio.seek()
|
print("Done ")
|
self.fxio.motoroff()
|
if self.abort.is_set():
|
wx.CallAfter(self.UpdateStatus, "UserStop.")
|
print("\nUser stopped.")
|
wx.CallAfter(self.Stop)
|
return
|
wx.CallAfter(self.UpdateStatus, "Saving")
|
print(f'Saving as "{adf}".')
|
try:
|
with open(adf, "wb") as fh:
|
fh.write(diskdump)
|
print("ADF Saved.")
|
wx.CallAfter(self.UpdateStatus, "Done.")
|
except:
|
print("Error writing adf file.")
|
wx.CallAfter(self.UpdateStatus, "FileError.")
|
wx.CallAfter(self.Stop)
|
return
|
# <FILESEP>
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
import argparse
|
import multiprocessing as mp
|
import os
|
import cv2
|
import detectron2.data.transforms as T
|
import numpy as np
|
import torch
|
from detectron2.checkpoint import DetectionCheckpointer
|
from fewx.config import get_cfg
|
from detectron2.data import MetadataCatalog
|
from detectron2.data.detection_utils import read_image
|
from detectron2.modeling import build_model
|
from detectron2.utils.logger import setup_logger
|
from GradCAM.rpn_cam import GradCAM, GradCamPlusPlus
|
from skimage import io
|
from torch import nn
|
# constants
|
WINDOW_NAME = "COCO detections"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.